Question
use Java to write the following java program Prompt the customer for their age. If they enter an age that is not an integer value,
use Java to write the following java program
Prompt the customer for their age. If they enter an age that is not an integer value, it means that they do not want to participate in the survey. Use a try block to detect this situation, and a catch block to display a message telling them the customer that you understand they do not want to participate.
If the customer enters their age, it means that they do want to participate in the survey. Prompt them for the name of a file that contains standardized, two character abbreviations for each state, along with the names of the states. Use a try block to detect the situation in which the file cannot be opened, and a catch block do display a message telling the customer that the file cannot be opened. Read the contents of the file into a 50 row x 2 column array.
Prompt them for the standardized, two character abbreviation of their home state (dont be case sensitive). Compare the value they entered against the contents of the state information array. Prompt the user for their five digit zip code. Use a try block to detect the situation in which the zip code entered is not an integral value, and a catch block to display a message to the customer.
Display the customers age, state name and zip code, and display a message telling the customer their participation is valuable.
Use a final clause associated with the first try block to display a message that thanks the customer for participating in the survey.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started