Question 1
Use functional decomposition, write C++ program that will prompt user to enter
the radius and height for a cylinder and then calculate the volume for the
cylinder and then display the height, radius and volume.
Use π = 3.14 and the formula for volume is : volume = π radius2
*height
You must use pass-by-reference mechanism to get the value for radius and height
using a single function, say getRadiusHeight().
Remember to add documentation for your function; what it does, preconditions and
postconditions.
Please do not just post your homework assignments. The forum rules clearly state that we will not make your homework for you. Also, it is considered rather rude to just post the assignment without any further explanations or questions.
Please give this a go yourself and get back to us with your attempted code. If you need any help getting started, just say so.
A small hint to get you going: Functional decomposition means giving every task its own function. If you look at the assignment you can see phrases like "prompt the user", "calculate the volume", "display the height, radius and volume". These are portions of the program which could each get their own function.