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()

  1. Prompts the user to enter the height, length, and depth of a cube
  2. 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)

  1. Calls another function that will calculate and return the volume of the 'reduced' cube

- arguments must be passed by value

  1. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!