Starting from:
$30

$24

Lab #2 User input and boolean logic solution

Lab Description




In this lab you will create a Java file, MyJavaLab02.java and complete the three outlined objectives below.







Objective 1




Print your name and student ID to the screen, in the format: YourLastName, YourFirstName, YourStudentID




Objective 2




In the main method, prompt the user with the below questions and store their input in variables with proper names (e.g. store age inside a variable with the name age).

What is your age?

What country would you like to visit (USA or Mexico)?







Note: the questions should be phrased exactly as they appear above







Objective 3




Print to the screen what country they selected, what age they are, and if they are legally allowed to drink in the country they want to visit:

You selected USA, and your age is 19. Legally allowed to drink: false







Remember: you are legally allowed to drink if:

in the USA and age is greater than or equal to 21

or

in Mexico and age is greater than or equal to 18.







What do you have to turn in?




A Java file named MyJavaLab02.java inside a zip folder named LastNameFirstName-lab02.zip







Criteria for grading:




● [20 pts] Your lab is submitted according to specifications (proper name of file, proper format)

● [20 pts] Well commented code explaining what you are doing (clear and grammatically correct)

● [60 pts] Correctly implemented solution of the above problem statement

More products