Question: make a program in c++ Menus In this lab, we are going to make a menu where the user has the option of accomplishing multiple

make a program in c++
 make a program in c++ Menus In this lab, we are

Menus In this lab, we are going to make a menu where the user has the option of accomplishing multiple things. You'll be required to use a do-while loop for the menu so that it can loop the options back to the user once a task has been completed. If the user enters a 0 (or some other number or character), break out of the loop so the program can end successfully. If you feel comfortable using a while loop for the menu, you can. You can either use switch statements or if-else statements to hone in on the entered task. If you are using switch statements, make sure each case has its own block. I will explain how to do this before we begin the lab. Your program is required to perform four tasks that the user can pick from: The first task is to ask a user for an integer greater than or equal to zero so that you can calculate and output it's factorial. Let's refer to this number as n. You are supposed to output n!. There is no factorial operator in C++. As a refresher of factorials, suppose that n = 5, then 5! = 5*4*3*2* 1. Note that the user can enter n = Oand that o! is equal to 1 to be sure to account for this edge case in your code. Feel fee to use either while loops or for loops to solve this. I will give a brief example on how to use accumulators to store your result before you begin the lab. The second task is the number guessing game except that you will loop through till the user guesses the number. Your number should be randomly generated (every time) and be between a reasonable range (between 1 and 10 is a good one) Your third task will have the user entering the number of times a coin will be flipped. Take that number and generate that many random numbers between 0 and 1. Let zero be tails and 1 be heads. Output the number of heads and tails obtained as well as the likelihood in percent. So, if I toss a coin 10 times, and 7 are heads. We divide 7 by 10(the total amount of tosses) and multiply by a 100 to get 70% heads and 30% tails. Note, that I want your percentages to be rounded off at two decimals places. 35.72% Correct, Wrong 37.4254585% Your fourth task is something unique to you. Come up with anything, the user doesn't have to input anything. It can be as simple or complex as you want it to be as long as it works. Happy coding

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!