Question: 1.Write a function that simulates tossing. a coin. The function will need to generate a random number and then decide whether to display HEADS or

1.Write a function that simulates tossing. a coin. The function will need to generate a random number and then decide whether to display "HEADS" or "TAILS". The function will return information to main to indicate heads or tails. You decide how your function should do this.

2.Write a section of code that would appear in a main function to do the following : -Ask user how many times he wants you to toss a coin. -Write a code to "toss the coin" the requested number of times. You must call the function you wrote from question 1. -At the conclusion, print out the number of times HEADS appeared, and the number of times TAILS appeared

In c++ language pls. You are only allowed to use the following functions on number question 1: #include #include #include #include 2 questions not 1. They are relatable that why I'm asking both at once. Pls create a space between your answers so that I can differentiate between the two.

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!