Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Recommended Textbook for

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago