admin管理员组

文章数量:1648463

9.7(Account类)设计一个名为Account的类

  • 题目
    • 破题
  • 代码
    • Test7
    • Test7_Account
    • 执行结果
  • UML图

题目

破题

Test7:测试程序
Test7_Account:实现题目要求

代码

Test7

public class Test7 {
   
    public static void main(String[] args) {
   
        // 创建对象
        Test7_Account ta = new Test7_Account(1122, 20000);
        ta.setAnnualInterestRate(4.5);

        // 取款
        ta.withDraw(2500);
        // 存款
        ta.deposit(3000);

        // 打印
        System.out.println("余额:" 

本文标签: 黑皮课后年利创建一个率为