Quantcast
Channel: MEPO Forum - 程式設計
Viewing all articles
Browse latest Browse all 99

TQC+ JAVA6 物件導向程式語言 - 610:員工薪資制度 (no replies)

$
0
0
題目一:

原始檔:


結果檔:




執行結果




題目二:

原始檔:



結果檔:



執行結果





  1. 在 class Employee中,加入

    1. double isHeigh( Empolyee e ):line 7~13
    2. double monthTax():line 14

  2. 在JPA06_2中加入 line28~29的敘述





題目三:

原始檔:


結果檔:



執行結果


在 class Empolyee 中:

  1. 加入兩個靜態變數:line5~6
    static int account;
    static double totalTax;
  2. 修改 Emplyee( int n),在 line 11 加入 account++;
  3. 修改 double monthTax(),在line23加入 totalTax += ( monthlyPay * 0.15 );
  4. 加入 static double getAverageTax():在line26
    只有類別方法可以使用 類別變數





題目四:

原始檔:


結果檔:



執行結果



增加物件 class Management





題目五:

原始檔:


結果檔:




執行結果




  1. 在 物件 class Management 中新增一個函式 totalPay()
  2. 新增一個物件 class totalPayException extends Exception
  3. 新增主程式中的 line 45~46

Viewing all articles
Browse latest Browse all 99

Trending Articles