read a line of text from the console
i.e String colour = readLine("Enter your favourite colour? ");
read an integer from the console
i.e int numGarage = readInt("Enter the number of garages: ");
read a double value from the console
i.e double avg = readDouble("Enter your grade average: ");
read as boolean value from the console
i.e boolean pancakes = readBoolean("Do you like pancakes(true/false)");
<dataType> <variableName> = <readCommand>("<prompt>");
Create a program UserInput.java that asks for the following information and then outputs the information back to the console
- name
- age
- current mark
- has been assigned a locker
Enter your name: John
Enter your age: 16
Enter your current mark: 92.3
Have you been assigned a locker (true/false): true
Name: John
Age: 16
Current Mark: 92.3
Locker Assigned: true
Modify UserInput.java so that it prompts for a first name and last name