設定 EYNY 為首頁  |  加入我的最愛
伊莉討論區
熱門搜尋:1895 家庭教師 海賊王 蒼井空 天罪 女郎我最兔 波麗士大人 歌舞青春 
最新搜尋:尋秦記  模範秘書 投名狀 迷藥 夜勤病棟 歌舞青春 愛不懂事 


休閒聊天
學術文化
感情感性
興趣交流
家庭事務
旅遊交流
飲食交流
寵物交流
貼圖分享
動漫交流
音樂世界
美容打扮
潮流資訊
影視娛樂
電玩遊戲
網絡遊戲
BL/GL 區
短片分享
下載分享
BT下載區
CB下載區
電腦資訊
數碼產品
手機交流
網站事務
體育運動
時事新聞
上班一族
博彩娛樂
成人話題

C & C++ 語言C# 語言Visual Basic 語言PHP 語言JAVA 語言CGI 語言

 
標題:[教學] IVE Exercise 3.1 Sample
天晴
(Stephen)
天晴
Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9
管理員
潛水  
UID 5
精華 14
積分 31415
帖子 18849
潛水 343066 米
閱讀權限 200
註冊 2004-5-23
來自 心情車站 Heart's Station
發表於 2005-10-27 06:35 PM  資料 主頁 文集 短消息  ICQ 狀態 Yahoo!
伊莉空間

[教學] IVE Exercise 3.1 Sample

[顯示][隱藏]
[code]
// Exercise 3.1

import javax.swing.*;

public class sale_amount {
  
  static String input_goal_st;
  static int input_goal_int;
  static double base_salary = 5000;
  static double rate_1 = 8;
  static double rate_2 = 10;
  static double rate_3 = 12;
  static double limit_high_1 = 5000;
  static double limit_high_2 = 10000;
  static double limit_high_3 = 10000.01;
  static double limit_low_1 = 0.01;
  static double limit_low_2 = 5000;
  static double limit_low_3 = 10000;
  static String range_1 = "$0.01 - $5,000";
  static String range_2 = "$5,000.01 - $10,000";
  static String range_3 = "$10,000.01 and above";
  static double total_month = 12;
  static double mini_amount;
  static double sale_amount;
  static double sale_amount_final;
  static String x;
  static double y;
  static double z;
  static double w;
  static int i;
  
  public static void main(String[] args) {
   
    input_goal_st = JOptionPane.showInputDialog(null, "Input your targe commission of this year", "Calculation of commission",
                                                JOptionPane.QUESTION_MESSAGE);
   
    input_goal_int = Integer.parseInt(input_goal_st);
   
    for(i = 1; i <= 3; i++) {
      
      switch(i) {
        case 1 : x = range_1; y = limit_high_1; z = rate_1; w = limit_low_1;
        break;
        case 2 : x = range_2; y = limit_high_2; z = rate_2; w = limit_low_2;
        break;
        case 3 : x = range_3; y = limit_high_3; z = rate_3; w = limit_low_3;
        break;
      }
      
      mini_amount = (w * total_month);
      sale_amount = (base_salary) + (y * (z / 100) * total_month);
      
      if (sale_amount >= input_goal_int) {
        sale_amount_final = (input_goal_int - base_salary) * (100 / z);
        if ( sale_amount_final >= mini_amount) {
        System.out.println("The sale amount to meet your goal is " + sale_amount_final + "\nCommission rate is " + z + "\nSales amount range is " + x);
  [ 瀏覽完整內容請先註冊或登入會員。]



 附件: 您所在的用戶組無法下載或查看附件 - 立即升級用戶組
頂部
 




當前時區 GMT+8, 現在時間是 2008-11-22 10:33 PM

Powered by Discuz! 5.0.0 © 2001-2006 Comsenz Inc.
Processed in 0.160394 second(s), 6 queries, Gzip enabled

清除 Cookies - 聯繫我們 - 廣告查詢 [威旭代理] - 伊莉討論區 - Archiver
重要聲明:本討論區是以即時上載留言的方式運作,伊莉討論區對所有留言的真實性、完整性及立場等,不負任何法律責任。而一切留言之言論只代表留言者個人意見,並非本網站之立場,用戶不應信賴內容,並應自行判斷內容之真實性。於有關情形下,用戶應尋求專業意見(如涉及醫療、法律或投資等問題)。 由於本討論區受到「即時上載留言」運作方式所規限,故不能完全監察所有留言,若讀者發現有留言出現問題,請聯絡我們。伊莉討論區有權刪除任何留言及拒絕任何人士上載留言,同時亦有不刪除留言的權利。切勿撰寫粗言穢語、誹謗、渲染色情暴力或人身攻擊的言論,敬請自律。本網站保留一切法律權利。