Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a java program that prompts the user (using JOptionPane) to enter first name, last name and age for two persons. You need to use

Write a java program that prompts the user (using JOptionPane) to enter first name, last name and age for two persons. You need to use separate dialog boxes for each input (i.e., six separate dialog boxes for the inputs). 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 a JOptionPane dialog box in the following format (Note that Smith and Doe are the last names in the examples shown below):

First Person: Smith, John (31) Second Person: Doe, Mike (35) Smith is younger than Doe

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions