Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c not c++ 5.4 Write the function header (function prototype) for each of the following functions. a) Function hypotenuse that takes two double- precision floating-
c not c++
5.4 Write the function header (function prototype) for each of the following functions. a) Function hypotenuse that takes two double- precision floating- point arguments, side1 and side2, and returns a double- precision floating- point result. b) Function smallest that takes three integers, x, y, z, and returns an integer. c) Function instructions that does not receive any arguments and does not return a value. [ Note: Such functions are commonly used to display instructions to a user.] d) Function intToFloat that takes an integer argument, number, and returns a floating-point result. 5.31 (Coin Tossing) Write a program that simulates coin tossing. For each toss of the coin the program should print Heads or Tails. Let the program toss the coin 100 times, 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. [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.] Use an enum for the coin (heads/tails) so you can use a switch that has heads or tails as switch cases instead on 0 and1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started