Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language- C This assignment is to create the Coin Tossing application. Write a program that simulates coin tossing. You will need to use current time

Language- C

image text in transcribed

This assignment is to create the Coin Tossing application. Write a program that simulates coin tossing. You will need to use current time for generating randomized random number. For each toss of the coin the program should print Heads or Tails Let the program toss the coin 100 times (use a for loop in here), and count the number of times each side of the coin appears. Print the results The program should call a separate function flip that takes no arguments and returns 0 for tails and 1 for heads. You will need to create this function flip and call it in the main function. [Note: If the program realistically simulates the coin tossing, then each side of the coin should appear approximately half the time for a total of approximately 50 heads and 50 tails.] The sample of output: Microsoft Visual Studio Debug Console ails Tails Heads HeadsTailsTails HeadsTails HeadsTails ails Heads Heads Heads Tails Tails Heads Heads Heads Heads ails TailsHeads TailsTails Heads Heads Tails TailsTails ails Heads Heads Heads Tails Heads Heads Ta ailsTails Heads Heads HeadsHeads Tails Tails Heads Tails eads Tails Tails Tails Heads Tails HeadsTails Tails Heads eads HeadsHeads Tails Heads HeadsTails Tails Heads Heads eads Tails Heads Tails Tails Tails Heads Heads Heads Tails eads Tails Heads Heads Heads Tails Heads Heads Heads Tails eads Hea ils Tails Heads ds Tails Heads Heads Tails Tails Heads Heads Heads he total number of Heads was 55 he total number of Tails was 45

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

Students also viewed these Databases questions