Question: 1. Write a java program that prompts the user to enter first name, last name and age for twopersons. You should store the names in
1. Write a java program that prompts the user to enter first name, last name and age for twopersons. 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 followingformat (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 DoeorFirst Person: Doe, John (31)Second Person: Smith, Mike (31)Doe is of same age as SmithorFirst Person: Doe, John (35)Second Person: Smith, Mike (31)Doe is older than Smith
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
