Home / Software / Computer programming / Questions need solving please ?
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: Questions need solving please ?  (Read 175 times)
Majed
Topic Starter
Starter



Posts: 3

Experience: Beginner
OS: Unknown

« on: February 28, 2011, 12:29:12 PM »

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.
IP logged
Allan
Moderator
Genius



Thanked: 856
Posts: 14,482

Experience: Guru
OS: Windows 7



Forum Administrator
« Reply #1 on: February 28, 2011, 12:32:28 PM »

Sorry, we don't do homework.
IP logged
Pages: [1] - (Top) Print 
Home / Software / Computer programming / Questions need solving please ? « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.084 seconds with 20 queries.