Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
Java程式~~緊急~~12點前要 12點後刪發問
Jun 17th 2013, 03:05

1
要求:
設計龜兔賽跑的模擬程式,在主執行緒main中啟動兩個執行緒
(烏龜執行緒 和 兔子執行緒):
烏龜執行緒要走m步才完成;而兔子執行緒要走n步才完成。
顯然m遠大於n,但是兔子執行緒每走1步就會休息k毫秒。
本程式可讓使用者自由從鍵盤輸入 m, n 和 k,隨後各執行緒自行執行,最後輸出是烏龜還是兔子獲勝。

執行結果範例:(也可將執行緒執行過程顯示增加生動感)
***龜兔大賽***
烏龜要走幾步才完成:10000
兔子要走幾步才完成:500
兔子每走1步要休息幾毫秒:20
--->龜兔大賽的贏家是--->烏龜
2
要求:
完成如下的功能選單並允許使用者輸入功能代碼,再對應功能下可再輸入需求值,最後能計算並輸出該項功能的結果,隨後返回功能選單繼續操作:

1. 輸出班級、學號、姓名
2. 計算三角形 (請輸入 底 和 高)
3. 測試某個民國年是否為閏年 (請輸入 民國年)
4. 龜兔賽跑的模擬程式
0. 離開
--->請選擇一項功能代碼(0~4): _

緊急!!!

This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 sdfgdf2 的頭像
    sdfgdf2

    中文名字日文翻譯, 中文翻譯日文名字, 名字日文翻譯, 日文翻譯名字, 日文翻譯字典發音, 日文翻譯網 漢字,

    sdfgdf2 發表在 痞客邦 留言(0) 人氣()