国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

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

代寫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 程序設計
  • 下一篇:菲律賓工簽面簽多長時間  工簽辦理費用
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 豆包網頁版入口 破天一劍 目錄網 排行網

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

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

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    久久精品99国产精品酒店日本| 国产乱码精品一区二区三区日韩精品 | 亚洲国产精品www| 色综合五月天导航| 欧美一级免费视频| 国产精品亚洲二区在线观看| 色噜噜亚洲精品中文字幕| 国产精品久久久91| 精品日本一区二区三区在线观看 | 国产精品高潮呻吟视频| 欧美一区二区在线| 久久免费视频在线| 蜜臀久久99精品久久久无需会员 | 国模私拍一区二区三区| 久久久91精品国产一区不卡| 日本www高清视频| 69av在线视频| 天堂资源在线亚洲资源| 国产欧美精品一区二区三区| 波霸ol色综合久久| 在线观看免费91| 99热久久这里只有精品| 国产精品久久网| 日本一道本久久| 色综合久久悠悠| 麻豆一区区三区四区产品精品蜜桃 | 欧美不卡福利| 成人免费在线小视频| 久久夜色精品国产欧美乱| 欧洲精品一区二区三区久久| 97国产在线视频| 一区二区三区日韩视频| 成人在线免费观看一区| 国产精品国产精品国产专区不卡 | 成人欧美一区二区三区黑人免费| 国产精品高潮呻吟视频| 激情视频综合网| 久热精品视频在线| 亚洲熟女乱色一区二区三区| 成人av.网址在线网站| 亚洲精品国产精品久久| 91久久大香伊蕉在人线| 亚洲乱码国产一区三区| 国产精品91在线| 性亚洲最疯狂xxxx高清| 久久精品综合一区| 日日噜噜噜噜夜夜爽亚洲精品| 久久亚裔精品欧美| 日本精品久久久久久久| 久久久久久久久久久久久久国产| 日本高清视频免费在线观看| 亚洲综合在线做性| 国产成a人亚洲精v品在线观看| 欧美一级黄色影院| 久久国产日韩欧美| 欧美在线免费视频| 欧美成aaa人片在线观看蜜臀| 国产免费人做人爱午夜视频| 久久69精品久久久久久久电影好| 国产欧美日韩高清| 国产精品国模在线| 国产区一区二区三区| 中文字幕日本最新乱码视频| 91精品久久久久久久久中文字幕| 手机在线观看国产精品| 国产精品久久久久久久电影 | 91免费版看片| 国产人妻互换一区二区| 国产精品手机播放| 精品一区二区三区免费毛片| 中文字幕无码精品亚洲资源网久久 | 九色91国产| 欧美日韩另类丝袜其他| 一区二区三区免费看| 国产大片精品免费永久看nba| 热99精品只有里视频精品| 一区二区视频在线免费| 久久精品国产久精国产一老狼| av动漫在线播放| 精品欧美一区二区久久久伦 | 国产精品三级在线| 国产精品亚洲综合| 欧美中文字幕在线观看| 亚洲一二三区在线| 国产精品久久7| 久久久久久亚洲精品| www污在线观看| 国产一区视频观看| 欧美一区深夜视频| 日日骚一区二区网站| 欧美激情第三页| 国产精品久久久久久久久久新婚 | 亚州精品天堂中文字幕| 久久夜色精品亚洲噜噜国产mv| 久久久之久亚州精品露出| 国产欧美日韩丝袜精品一区| 欧美凹凸一区二区三区视频| 日本精品视频网站| 日韩一区二区三区资源| 欧美日韩福利电影| 久久中文字幕在线| 国产精品精品久久久久久| 日韩在线欧美在线| 国产成人亚洲欧美| 国产精品 日韩| 成人美女免费网站视频| 黄色av免费在线播放| 日韩亚洲不卡在线| 亚洲色欲久久久综合网东京热| 免费不卡在线观看av| 国产精品视频白浆免费视频| 久久综合精品一区| 97精品国产97久久久久久粉红 | 国产欧美在线一区二区| 精品欧美日韩| 黄色片久久久久| 欧美精品国产精品久久久| 视频在线一区二区三区| 熟妇人妻va精品中文字幕| 亚洲黄色网址在线观看| 亚洲国产精品一区在线观看不卡| 中文字幕制服丝袜在线| 伊人天天久久大香线蕉av色| 一区二区三区精品国产| 亚洲在线免费看| 亚洲精品一区二区三| 午夜精品久久久久久久99热浪潮| 亚洲精品自在在线观看| 一区二区三视频| 亚洲最大av在线| 亚洲成人av动漫| 日日碰狠狠躁久久躁婷婷| 午夜精品久久久久久99热| 懂色一区二区三区av片| 亚洲第一综合| 日韩欧美精品在线不卡| 欧美少妇在线观看| 国产在线精品一区二区三区》 | 99国产盗摄| 国产成人精品免费视频| 日韩中文在线不卡| 国产精品美女无圣光视频| 精品国产综合区久久久久久| 一区二区精品在线观看| 亚洲不卡中文字幕无码| 日本一区视频在线观看免费| 任我爽在线视频精品一| 麻豆久久久av免费| 国产乱肥老妇国产一区二| 91久久精品国产91性色| 久久av二区| 国产精品久久久久免费| 一区二区三区四区免费视频 | 欧洲日本亚洲国产区| 蜜桃成人在线| 99在线观看视频| 久久精品国产综合精品| www.日韩系列| 中文字幕人妻熟女人妻洋洋| 日韩资源av在线| 国内精品国产三级国产在线专| 国产精品尤物福利片在线观看| 国产精品99久久久久久www| 日韩在线观看免费高清| 精品国产免费人成电影在线观... 精品国产免费一区二区三区 | 日本欧美色综合网站免费| 日韩精品―中文字幕| 国产又黄又猛视频| 国产精品8888| 久久夜色精品亚洲噜噜国产mv| 欧美极品美女电影一区| 无码av天堂一区二区三区| 欧美日韩一级在线| 91精品视频大全| 久久天天躁狠狠躁夜夜爽蜜月| 欧美人与性动交| 品久久久久久久久久96高清| 国产精品一区二区三区精品| 久久99精品久久久久久三级| 国产精品久久久久久久久久久久冷| 亚洲欧美国产不卡| 精品人伦一区二区三区| 7777精品伊久久久大香线蕉语言| 国产精品美女主播| 日本一区二区黄色| 国产卡一卡二在线| 久久久精品2019中文字幕神马| 在线观看日本一区| 男人添女人下部视频免费| 7777精品久久久大香线蕉小说| 国产精品久久久999| 日本中文字幕在线视频观看| 国产精品主播视频| 国产精品男人爽免费视频1| 日本一区视频在线观看免费| 国产精品一区二区三区在线| 久久久久久久av| 亚洲 国产 日韩 综合一区| 国产欧亚日韩视频| 国产精品欧美久久久|