Question: Write a program to calculate the cost of making a copper cylinder. The program should read in the radius (in centimetres) of the cylinder, r,
Write a program to calculate the cost of making a copper cylinder. The program should read in the radius (in centimetres) of the cylinder, r, the height of the cylinder, h, and the cost in Euro per square centimetres of copper sheeting, c. Assume that there is 10% wastage in the manufacturing process (in other words, the amount of copper needed is 10% more than the actual surface area of the cylinder). Take pi=3.1416. The program should print the total cost in Euro of the copper cylinder and the wastage cost in Euro associated with this cylinder.
Make sure that all values are larger than 0 (print "Error" otherwise)
Hint: to read properly the input with scanf, you have to respect the specific format of the input which is in this case "r=%d h=%d c=%d".
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
