Question: Design a program that prompts the user to enter his or her age and first initial. Include code that checks for input failure in case

Design a program that prompts the user to enter his or her age and first initial. Include code that checks for input failure in case the user enters character data for numeric data. If input failure occurs, display a message and return the value 1 from your main function. If no input failure occurs, display a message that echoes the data entered.

example:

output.

Please enter your age and first initial: 19 J

Your age is 19 and your initial is J.

Please enter your age and first initial: J 19

You did not enter your age followed by your initial.

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!