Question: Use Scanner for input 1. Write a java program that prompts the user to enter first name, last name and age for two persons. You

 Use Scanner for input 1. Write a java program that prompts

Use Scanner for input

1. Write a java program that prompts the user to enter first name, last name and age for two persons. You should store the names in String variables and the ages in int variables. Your program should compare the two ages and print out the information in the following format (Note that Smith and Doe are the last names in the examples shown below): Sample output: First Person: Smith, John (31) Second Person: Doe, Mike (35) Smith is younger than Doe or First Person: Doe, John (31) Second Person: Smith, Mike (31) Doe is of same age as Smith or First Person: Doe, John (35) Second Person: Smith, Mike (31) Doe is older than Smith 2. Write a java program that prompts user to input an integer number and your program should check given integer is even or odd number. Sample output: Enter an integer number: Entered number is even 10 Enter an integer number: 11 Entered number is odd

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!