java 简单数组问题

来源:百度知道 编辑:UC知道 时间:2024/06/27 15:25:40
由于一周没上课,看不懂老师留的作业了,请高手指教一下

You are to develop two classes that will be used by a real estate company in their property listings system.

Listing Class:

This class contains the data on the all the current property listings – houses (listing type H) and building lots (listing type L)

Data members:
• listing number – int
• listing type – char
• location – String
• description - String
• asking price – float
• selling price – float
• sold – boolean

Constructors:
• a default constructor that will set the listing number to zero, the listing type to 'H', the location and description to null, the two float fields to zero and sold to false (use the keyword false)
• a 5-parameter constructor that is passed values for all members except selling price and sold; set selling price to zero, set sold to false

Methods:
• &

为房地产公司写两个类用于他们的系统。
类一:类名:Listing
字段:上面DataMember下的那几个
两个构造函数,一个无参listing number=0, the listing type='H', location="", description="", the two float fields to zero,sold= false,一个有参,
为每个字段写一个get方法,返回其值。
一个set方法设置asking price的值。
一个sale方法,设置selling price的值为传递过来的值,并设置sold=true
一个getCommission方法,用来获取commission rate
类二:类名:CommissionRate
两个字段:public static final float HOUSE_RATE=0.05f;
public static final float LOT_RATE=0.04f;