UniversityEssayServices

Write a C++ program that simulates coin tossing. For each toss of the coin the program should print Heads or Tails. The program should toss a coin 100 times. Count the number of times each side of the coin appears and print the results at the end of the 100 tosses.
The program should have the following functions as a minimum:

  • void toss() – called from main() and will randomly toss the coin and set a variable equal to the face of the coin
  • void count() – called from toss to increment counter for heads or tails
  • void displayCount() – is called from main() and will display the values of the counter for heads and the counter for tails.

If any global variables are used in the program, the program will receive a grade of 0.
So far what I have. Anything I should clean up? Also, I am confused on the global variables part specifically. Can you doublecheck to make sure I am not using any in the program. Any help is appreciated!! #include #include #include using namespace std; int totalCount=100; int headsCount=0; int currentCoinFace; void count() {    if(currentCoinFace==0)    {        headsCount++;        cout<><   =”” }=””   =”” else=””   =”” {=””   =””    =””><><   =”” }=”” }=”” void=”” toss()=”” {=””   =”” currentcoinface=”rand()” %=”” 2;  =””   =”” count();=”” }=”” void=””>
{    cout
 
 
total=”” number=”” of=”” heads=”<    cout<<” the=”” total=”” number=”” of=”” heads=””>

Found something interesting ?

• On-time delivery guarantee
• PhD-level professional writers
• Free Plagiarism Report

• 100% money-back guarantee
• Absolute Privacy & Confidentiality
• High Quality custom-written papers

Related Model Questions

Feel free to peruse our college and university model questions. If any our our assignment tasks interests you, click to place your order. Every paper is written by our professional essay writers from scratch to avoid plagiarism. We guarantee highest quality of work besides delivering your paper on time.

Sales Offer

Coupon Code: SAVE25 to claim 25% special special discount
SAVE