Problem

Assume the definition of class temporary as given in Exercise 13. Answer the following q...

Assume the definition of class temporary as given in Exercise 13. Answer the following questions: (1, 2, 3, 5)

a. Write the definition of the member function set so that the instance variables are set according to the parameters.

b. Write the definition of the member function manipulate that returns a decimal number as follows: If the value of description is "rectangle", it returns first * second; if the value of description is "circle", it returns the area of the circle with radius first; if the value of description is "sphere", it returns the volume of the sphere with radius first; if the value of description is "cylinder", it returns the volume of the cylinder with radius first and height second; otherwise, it returns the value -1.

c. Write the definition of the function print to print the values of the instance variables and the values returned by the function manipulate.

d. Write the definition of the constructor so that it initializes the instance variables using the function set.

e. Write the definition of the remaining functions to set or retrieve the values of the instance variables. Note that the function get returns the values of all instance variables.

REFEENCE:

Step-by-Step Solution

Request Professional Solution

Request Solution!

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.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 10
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT