Question: Prompt the User for Input: Ask the user to enter their name. Ask the user to enter their favorite color. Ask the user to enter

Prompt the User for Input:
Ask the user to enter their name.
Ask the user to enter their favorite color.
Ask the user to enter their age.
Ask the user to enter a number between 1 and 10.
Process the Input:
Store each piece of information in a variable.
Ensure the age and the number are integers.
Validate that the number is between 1 and 10 using a loop.
Convert the favorite color to uppercase.
Perform Calculations:
Add 10 to the number provided by the user.
If the user's age is an even number, multiply the result by 2.
If the user's age is an odd number, subtract 2 from the result.
Display the Information:
Print a summary that includes all the information provided by the user.
Display the favorite color in uppercase.
Display the result of the calculations.

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 Programming Questions!