Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedc++
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions

Question

Are employee benefits really necessary? Why?

Answered: 1 week ago

Question

=+country competitive advantages? Why? Support your point of view.

Answered: 1 week ago