Question
C++ Assignment (Please post the solution and the output) /* Please submit this program in pseudocode */ Requires: Variables, data types, and numerical operators, basic
C++ Assignment (Please post the solution and the output)
/* Please submit this program in pseudocode */
Requires: Variables, data types, and numerical operators, basic input/output, logic (if statements, switch statements), loops (for, while, do-while)
Write a program that continues to ask the user to enter any number other than 5 until the user enters the number 5. Then tell the user "Hey! You weren't supposed to enter 5!" and exit the program.
1) Modify the program so that after 10 iterations if the user still hasn't entered 5 will tell the user "Wow! You're more patient than I am. You win!" and exit.
2) Modify the program so that it asks the user to enter any number other than the number equal to the number of times they've been asked to enter a number. (i.e on the first iteration "Please enter any number other than 0" and on the second iteration "Please enter any number other than 1" and etc. The program must behave accordingly exiting when the user enters the number they were asked not to.)
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