Rewrite the Desks program from Exercise, passing all variables as reference variables and changing all the function return types to void. Save the file as Desks2.cpp.
Exercise
Write a program that calculates the cost of building a desk. The main()function calls four other functions. Pass all variables so that the functions make copies of any variables they receive:
» A function to accept as input from the keyboard the number of drawers in the desk. This function returns the number of drawers to the main program.
» A function to accept as input the type of wood—‘m’ for mahogany, ‘o’ for oak, or ‘p’ for pine.
» A function that receives the drawer number and wood type, and calculates the cost of the desk based on the following:
Pine desks are $100.
Oak desks are $140.
All other woods are $180.
A $30 surcharge is added for each drawer.
This function returns the cost to the main()function.
» A function to display the final price.
Save the file as Desks.cpp.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.