Question: Forcing the user to correct an input: You will create a basic scenario to get user input about choosing a color ( I ran out

Forcing the user to correct an input:
You will create a basic scenario to get user input about choosing a color (I ran out of ideas I'm
sorry!).
Get user input as a String. They must choose either Blue, Red, or Yellow.
Make a while loop to check for correct input. If the user does not enter any of these three
colors, make them re-enter the color choice. Continue this until they pick one of the listed
colors.
Also, include a counter variable to count how many times they incorrectly choose a color.
Output the number of times it took the user to complete this task.
Using loops to output patient data to a file:
In the existing program, create the necessary variables to output user information to a file called
"output.txt".
Ask the user how many patients they want to add to the "output.txt" file and store that as
an int.
Using either a for loop or a while loop, ask the user for the following data and output it to
the file for the number of patients the user wants to enter.
a. First name
b. Last name
c. Age
Forcing the user to correct an input: You will

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!