It should also provide a way to stop


We're writing codes and I'm completely lost on these:

1.You must implement a function with the following prototype:
void hailstones (int n) ;

The user only inputs the first hailstone number. All the rest and the total number of hailstones should be output by your program. 
Rubrics:
-No prompt line
-Incorrect hailstones
-Incorrect total number

2. Your program should satisfy the following requirements:
a. Except for main function, you must implement five other functions: square(), cube(), quartic(), quintic(), and sum() 
b. square() and cube() must be invoked in quartic() and quintic() functions.
c. square(), cube(), quartic(), quintic() must be invoked in sum().

3. Your program should satisfy the following requirements:
a. Your program should be able to process multiple inputs
b. It should also provide a way to stop the loop ("Ctrl +D")
c. Your program should then print the average of each item as shown in the example below.
d. Each output value must have exactly 2 digits after decimal point.

Example of output:
Please enter salary: 10
The salary is 10.00
The federal withholding is 2.30
The state withholding is 0.70
The salary after taxing is 7.00
Please enter salary: 20
The salary is 20.00
The federal withholding is 4.60
The state withholding is 1.40
The salary after taxing is 14.00
Please enter salary: ^D
The average of salaries is 15.00
The average of federal withholding is 3.45
The average of state withholding is 1.05
The average of salaries after tax is 10.50

4. Your code must do the following
a. generate 500,000 random numbers
b. print the difference between two counters in each loop
c. explain why the program is generating the same output every time you run the program. Do this with a printf() so that the grader can see this when they run your program. 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: It should also provide a way to stop
Reference No:- TGS088453

Expected delivery within 24 Hours