1.

Solve : Questions need solving please ??

Answer» 1. Design a class to represent a geometric rectangle with a given length and width, such that it
is capable of calculating the AREA and the perimeter of the rectangle.


2. Define a class that represents a TEMPERATURE object. It should store the CURRENT temperature
in an instance variable of type double, and it should have two public methods,
setTemp(double t), which assigns t to the instance variable, and getTemp(), which returns the
value of the instance variable.


3. Define a class named TaxWhiz that computes the sales TAX for a purchase. It should store
the current tax RATE as an instance variable. You can initialize the rate using a TaxWhiz()
method. This class should have one public method, calcTax(double purchase), which returns
a double, whose value is purchases times the tax rate. For example, if the tax rate is 4
percent, 0.04, and the purchase is $100, the calcTax() should return 4.0



Many thanks to all of you.





Figure 1.8.
Sorry, we don't do homework.


Discussion

No Comment Found