Question: Write a c++ program that does the following: In main() Prompts the user to enter the height, length, and depth of a cube Calls a
Write a c++ program that does the following:
In main()
- Prompts the user to enter the height, length, and depth of a cube
- Calls a function that will reduce the size of the height, length, and depth by half (ie. divide them each by 2)
- arguments must be passed using references
- handle possible resulting decimal values (ie. 3/2 = 1.5)
- Calls another function that will calculate and return the volume of the 'reduced' cube
- arguments must be passed by value
- Display the new height, length and volume of the cube
- ie. Height: 2.5 Length: 9 Depth: 3 Volume: 67.5
- The volume should be a float displaying 1 digit of precision
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
