99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫CS5002、代做 java 設計程序

時間:2024-03-18  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



Assessed Exercise II
CS5002 Advanced Programming
• Deadline: 16:30 on 19th March 2024
• Contribution to final course mark: 25% • Solo or Group: Solo work
• Anticipated duration: 3 hours
Introduction
From the course Moodle page, download the files CommandRunner.java and SlowCalculator.java. The latter contains a class SlowCalculator implement- ing Runnable. Its constructor takes a number N as input and stores it. Method run performs a long, slow calculation on this number, then prints the result. You do not need to consider (or even understand) the mathematical details of what is being calculated!
In this exercise, you will write a class implementing the interface CommandRunner, that runs certain commands passed as strings. These are inputs from a user, requesting the calculation be performed for particular numbers. The inputs and outputs are read/written by a separate part of the program – you just have to use the passed string, and return a string.
As the calculation is slow, you will run it on background threads, so the user can continue to interact with the system while tasks are running. To take advantage of modern multi-core CPUs, the user may request several calculations be run in parallel. Each calculation will still run on one single thread – your goal is to let the user run multiple calculations in parallel, not to make the individual calculations faster.
Task
You will write a class called Solution that implements the CommandRunner interface. The runCommand method of this class will be passed a string, cor- responding to a command the user entered. It should perform the relevant command (see below), and return the specified output string. You should not modify the interface CommandRunner in any way. Your Solution class should have a public constructor taking no parameters.
1

The following table lists the commands the user may enter (i.e. that may be passed as the command argument to your Solution.runCommand method), and the required behaviour of your runCommand method (note N and M are long integers chosen by the user):
start N
cancel N
running
get N
after N M
finish
abort
start calculating with input N, by calling SlowCalculator.run on a new thread; imme- diately return the message “started N”
immediately cancel the calculation with input N that is currently running (do nothing if it already completed or if it was never started); when it has stopped (which should be within 0.1s) return mes- sage “cancelled N”
return a message indicating the total number of calculations currently running (i.e. exclud- ing those already completed/cancelled), and their inputs N (in any order), in the form “3 calculations running: 83**6 1000 176544”. If no calculations are running, return the string “no calculations running”.
if the calculation for N is finished, return message “result is M” where M is the integer result; if the calculation is not yet finished, return message “calculating”. If the calculation was started but already cancelled, return message “cancelled”
assuming the calculation for N is already running, schedule the calculation for M to start when that for N finishes (or is cancelled). Return the message “M will start after N” immediately (without wait- ing for either calculation). The calculation for M should not appear in running until it is actually run- ning (i.e. N has completed)
wait for all calculations previously requested by the user (including those scheduled with after) to fin- ish, and then after they are all completed, return message “finished”
immediately stop all running calculations (and dis- card any scheduled using after), and then when they are stopped (which should be within 0.1s) re- turn message “aborted”
For any command not given above (including malformed commands, e.g. N is not an integer), the method should return message “Invalid command”.
2

Note that the provided code for SlowCalculator prints the answer at the end of run(). You must remove this print statement, and replace it with a suitable mechanism to return the result so your Solution class can retrieve it. You should not modify the mathematical calculations performed by either SlowCalculator.calculateNumFactors or SlowCalculator.isPrime, but you will need to add support for interruption. You may change other parts of this class if you want (e.g. adding new fields or constructor parameters). You must not change the names of the existing methods.
Here is an example of what should happen when your program runs; the highlighted lines are commands passed to runCommand, and the remaining lines
are the messages it returns:
start 10456060
started 10456060
running
1 calculations running: 10456060
get 10456060
result is 3
start 72345680
started 72345680
start 534912560
started 534912560
get 534912560
calculating
running
2 calculations running: 72345680 534912560
cancel 72345680
Cancelled 72345680
running
1 calculations running: 534912560
finish
finished
Notes
• We will not test on pathological inputs for which the behaviour is not defined, i.e. not specified above. Please do not ask questions about any special cases you may think of (e.g. starting a calculation that is already running, or cancelling a calculation scheduled with after but not yet started). It does not matter what your program does in such cases
• Do ensure you return “Invalid command” (as mentioned above) if you receive a command that is not of the required form (e.g. N is missing or not an integer, or a command is misspelt)
• Your program should not limit the number of calculations/threads that can be run in parallel
3
           
• Your program should not print any output directly, nor read from the console
• Do not use any deprecated methods, such as Thread.stop() (such meth- ods are typically deprecated because they are dangerous, and so it is bad practice to use them)
• Remember the goal of this exercise is not to make each individual calcu- lation parallel, but to run several independent calculations for different N in parallel!
Submission
• You must implement a class Solution in file Solution.java, inheriting from CommandRunner. Do not put your code in a Java package (i.e. do not use the package keyword in any files).
• You will submit a single .zip file (not a tar, or a rar, or anything else), named 1234567.zip where 1234567 is replaced by your 7-digit numeric student ID
• This .zip file shall contain no folders, (e.g. src/), but only the .java files containing your code, including SlowCalculator.java and Solution.java, and maybe others if you wish
• Do not include CommandRunner.java in your submission
• Do not include a main method anywhere
• Upload your .zip file to Moodle before the deadline!
Mark Scheme
Your submission will be marked out of 50 points, broken down as follows: • Code is provided in the correct form and compiles successfully [5]
• start, running, get and cancel commands work as expected [20] • finish and abort commands work as expected [15]
• after command works as expected [10]
If you do not follow the exercise specification precisely, you will lose marks (your submission will be processed by a computer program; it will assume you’ve followed the instructions).
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

掃一掃在手機打開當前頁
  • 上一篇:CS 3800 代做、代寫 Python ,java 程序設計
  • 下一篇:菲律賓工簽面簽多長時間  工簽辦理費用
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                337p亚洲精品色噜噜| 91精品国产入口| 99综合电影在线视频| 岛国av在线一区| 成人午夜激情片| 91天堂素人约啪| 91黄色免费版| 91精品福利在线一区二区三区 | 欧美日韩久久一区| 欧美亚洲一区三区| 欧美日韩久久久| 日韩欧美成人激情| 国产欧美一区二区三区鸳鸯浴| 国产欧美日本一区二区三区| 肉肉av福利一精品导航| 国产大陆亚洲精品国产| 欧美成人vps| 久久久91精品国产一区二区三区| 欧美一级在线免费| 日韩精品中文字幕在线不卡尤物| 欧美亚洲一区三区| 欧美系列亚洲系列| 日韩一区二区精品| 国产精品久久久爽爽爽麻豆色哟哟| 一区二区在线观看视频在线观看| 日韩激情视频网站| 色综合中文字幕国产| 欧美日韩视频在线一区二区| 免费观看久久久4p| 久久99精品久久久久婷婷| 亚洲国产日韩a在线播放性色| 一区二区三区不卡视频| 青娱乐精品视频| 久久久精品2019中文字幕之3| 日韩区在线观看| 亚洲一区二区三区四区中文字幕| 这里只有精品免费| 亚洲高清视频中文字幕| 成人福利视频在线| 久久免费国产精品| 日韩黄色一级片| 在线观看日韩一区| 亚洲高清视频中文字幕| 欧美日韩视频不卡| 免费在线视频一区| 51午夜精品国产| 日本伊人午夜精品| 欧美一区二区精品久久911| 美腿丝袜在线亚洲一区| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲综合av网| 日本韩国一区二区| 亚洲综合视频在线| 成人黄色av电影| 精品国产免费一区二区三区香蕉| 成人一区二区三区在线观看| 在线日韩国产精品| 精品无人码麻豆乱码1区2区| 日韩三级伦理片妻子的秘密按摩| 日本视频一区二区三区| 日韩视频中午一区| 国内精品免费**视频| 国产精品网站在线观看| 欧美在线观看一区| 久久99精品视频| 亚洲精品免费视频| 国产成人精品三级麻豆| 欧美女孩性生活视频| 亚洲欧美视频在线观看视频| 久久电影网电视剧免费观看| 99精品桃花视频在线观看| 久久久www免费人成精品| 亚洲mv在线观看| 在线观看日韩电影| 一区免费观看视频| 国产精品亚洲成人| 国产精品久久久久久久裸模| 9i看片成人免费高清| 中文字幕欧美一区| 99综合电影在线视频| 亚洲精品少妇30p| 欧美三级电影网站| 美女视频黄 久久| 日韩欧美亚洲一区二区| 麻豆国产欧美一区二区三区| 欧美变态tickling挠脚心| 精品在线一区二区| 中文字幕乱码亚洲精品一区 | 欧美日韩中文精品| 日本成人在线看| 中文字幕+乱码+中文字幕一区| 99综合影院在线| 一级女性全黄久久生活片免费| 亚洲桃色在线一区| 亚洲午夜精品网| 日韩av在线播放中文字幕| 免费成人在线观看视频| 久久国产精品一区二区| 国产一区二区精品在线观看| 岛国一区二区三区| 欧美日韩三级一区二区| 欧美一区二区三区免费大片| 色婷婷综合中文久久一本| 捆绑紧缚一区二区三区视频| 亚洲色图欧美在线| 久久久久亚洲综合| 欧美一区二区私人影院日本| 在线日韩av片| 成人美女视频在线观看18| 天涯成人国产亚洲精品一区av| 日韩精品一区二区三区在线 | 成人精品gif动图一区| 国内精品国产成人国产三级粉色| 亚洲欧美日韩小说| 国产精品久久久久影院| 欧美成人vps| 欧美第一区第二区| 91精品国产乱码| 4438成人网| 制服丝袜日韩国产| 日韩欧美一区中文| 欧美精品一区二区三区视频| 日韩女优毛片在线| 5月丁香婷婷综合| 精品福利一区二区三区免费视频| 在线不卡中文字幕播放| 日韩欧美一区二区在线视频| 日韩三区在线观看| 国产日韩在线不卡| 中文字幕佐山爱一区二区免费| 依依成人综合视频| 日韩成人伦理电影在线观看| 国产精品一区二区91| 色综合天天性综合| 日韩免费性生活视频播放| 久久亚洲精精品中文字幕早川悠里| 久久精品这里都是精品| 蜜臀久久99精品久久久画质超高清| 欧美视频自拍偷拍| 午夜激情久久久| 欧美成人vps| 色综合久久综合网97色综合| 亚洲日穴在线视频| 91精品在线观看入口| 国产精品99久久久久久似苏梦涵 | 午夜久久久久久久久| 精品精品国产高清一毛片一天堂| 久久99国产精品免费| 国产三区在线成人av| 色偷偷一区二区三区| 国模少妇一区二区三区| 亚洲区小说区图片区qvod| 欧美日韩在线不卡| 成人免费视频一区| 六月丁香综合在线视频| 亚洲欧洲成人自拍| 精品日韩在线观看| 欧美色老头old∨ideo| 国产成+人+日韩+欧美+亚洲 | av欧美精品.com| 久久国产精品免费| 视频在线观看91| 欧美一二三在线| 国产精品538一区二区在线| 精品国产91亚洲一区二区三区婷婷| 日本午夜一区二区| 欧美精品一区二区三区一线天视频| 美国十次了思思久久精品导航| 91麻豆精品国产自产在线观看一区| 亚洲韩国精品一区| 日韩美女视频一区二区| 欧美激情一区二区三区四区 | 日韩1区2区日韩1区2区| 日本不卡一二三| 久久99精品国产麻豆不卡| 日韩精品三区四区| 日韩精品国产欧美| 欧美aⅴ一区二区三区视频| 奇米色一区二区| 另类小说综合欧美亚洲| 久久超级碰视频| 韩国一区二区视频| 成人一区二区三区中文字幕| 不卡的av中国片| 一本色道**综合亚洲精品蜜桃冫 | 久久精品视频一区| 亚洲女同一区二区| 日本亚洲视频在线| 成人黄色在线网站| 欧美精品一二三四| 久久久精品天堂| 亚洲伊人色欲综合网| 韩国女主播成人在线| 欧美亚洲另类激情小说| 精品久久国产字幕高潮| 一色屋精品亚洲香蕉网站| 日韩精品乱码免费| 93久久精品日日躁夜夜躁欧美| 日韩免费电影一区| 亚洲精品美腿丝袜|