I am creating a Java console program that reads an input value consisting of letters and numbers and that result has to be carried over to the next input line.
However, whenever I enter numeral and alphabetical the program just returns an error code. Below is an outline of the code I've written. Where the int plate
code is, I feel like I need to input something different as I would like the code to register letters and numbers similar to AAA111
and return them to the next line of code.
Any help that can be provided on the problem and the coding layout itself (I'm still very new to all this) will be massively appreciated;
public static void main(String []args)
{
{
System.out.printf("Welcome to the input System\n\n");
Scanner inputObject = new Scanner(System.in);
int plate;
int hours;
System.out.printf("Enter the licence plate number of car 1 ==>");
plate = inputObject.nextInt();
System.out.printf("Enter the hours car: " +plate+ " was parked==>");
hours = inputObject.nextInt();
}
}