谁能帮我翻译这段题目(有涉及程序),拒绝机翻.

来源:百度知道 编辑:UC知道 时间:2024/06/02 00:03:25
a. Change all the Employee fields to be private.
b. Add an accessor method for each field.
c. Add a mutator method for each field.
d. Change your DatabaseManager main method to use your newly created accessor and mutator methods.
e. Add a constructor to your Employee class. This constructor should take 4 parameters, one for each of the Employee fields,and initialize them.
f. Change your DatabaseManager main method so that it creates and initializes employees using the new constructor.

Write a class called BankAccount and a main program class to demonstrate you have implemented the BankAccount class as described below.An object of class BankAccount has the following attributes:
• A unique accountNumber,which is stored as an integer.
• A firstname and surname
• An account type (can be“savings”,“credit”,or“cheque”)
• An account balance
• For credit accounts only, a credit amount. This is a negative

我来翻,just a minute,pls

a.把所有Employee域变成私有的.
b.给每个域添加一个访问方法.
c.给每个域添加一个改变对象实例域的方法.
d.改变你的DatabaseManager主函数来使用你创建的访问方法和改变对象实例域的方法.
e.为你的Employee类添加一个构造方法,这个构造方法要有4个参数,一个针对每一个Employee域,并且初始化这些参数.
f.修改你的DatabaseManager主函数,让它通过新的构造函数来创建和初始化employees(应该是Employee类所定义的对象).

写一个类命名为BankAccount,写一个主程序证明你已经实现了如下面所描述的BankAccount类.BankAccount类所定义的对象要包括如

下的属性:
有唯一的accountNumber,定义为整型
有一个fistname和surname(这些应该都是参数,不用翻译,名字)
有一个账户类型(可以叫做"savings(储蓄)","credit",或者"cheque".(这些都是储蓄,信用卡,支票的意思))
有一个account balance(帐户余额)
对于信用卡,要有一个信用卡金额.这帐户可以是一个负数(例如-500).对于储蓄和支票帐户这个值要设置成0.

a.看完练习2,为类BankAccount画一个类图,你必须得仔细思考这个类需要包含什么样的属性和方法.
b.基本实现类的轮廓,包括属性.
c.实现BankAccount类的缺省构造函数.你必须确认帐户类型,以及余额必须大于0,而信用卡里的金额不等于0.
d.为BankAccount类的每一个属性写访问方法,为其中一些属性写改变对象实例域的方法.在单独的word文档里说明哪些属性你认为要

建立改变对象实例域的方法.
e.写一个方法以用来更新帐户余额.储蓄和支票帐户的余额不能小于0,而信用卡帐户另外考虑.
f.写一个主函数命名为BankMa