1. Engineering
  2. Computer Science
  3. write a c program that does the following in main...

Question: write a c program that does the following in main...

Question details

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

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution