Question: c++ Coin Toss, v.3.0 Purpose. Learn how to use nested loops to put replay a program that already contains a loop. Requirements. Rewrite your coinToss2.cpp

 c++ Coin Toss, v.3.0 Purpose. Learn how to use "nested loops"c++

Coin Toss, v.3.0 Purpose. Learn how to use "nested loops" to put "replay" a program that already contains a loop. Requirements. Rewrite your coinToss2.cpp from exercise 7.4 as coinToss3.cpp. Modify the program to add another loop that lets the user replay the entire game. If the user enters sentinel value of 0 (zero) for the number of tosses, break out of the outer replay loop to end the program. Be sure to explain this to the user in the prompt -- something like: "Enter the number of tosses to perform [0=exit):". Supplemental. Read about "randomizing" in www.rdb3.com/cpp/exercises/Gaming supplemental.pdf. Program I/O. Input: a non-negative number from the console keyboard, repeated in a loop until the sentinel value of 0 is entered. Output: a series of Heads or Tails repeated in a loop until the sentinel value is entered. Example. with user input in blue Enter the number of tosses to perform [0=exit]: 3 Heads Tails Heads Enter the number of tosses to perform [0=exit]: 2 Tails Tails Enter the number of tosses to perform [0=exit]: 0

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!