Answered step by step
Verified Expert Solution
Link Copied!

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

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 and1

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_2

Step: 3

blur-text-image_3

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

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

Solve Prob. 27.4 with the finite-difference approach using x = 2.

Answered: 1 week ago