加勒比久久综合,国产精品伦一区二区,66精品视频在线观看,一区二区电影

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務合肥法律

代寫CS5002、代做 java 設(shè)計程序

時間:2024-03-18  來源:合肥網(wǎng)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 程序設(shè)計
  • 下一篇:菲律賓工簽面簽多長時間  工簽辦理費用
  • 無相關(guān)信息
    合肥生活資訊

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

    關(guān)于我們 | 打賞支持 | 廣告服務 | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    免费看男女www网站入口在线| 超碰精品在线| 黑人巨大精品| 亚洲性视频h| 日韩av一级电影| 一区二区三区国产在线| 亚洲深夜激情| 久久久久中文| 日韩三级av| 亚洲另类视频| 国产亚洲一区二区手机在线观看| 亚洲精品极品少妇16p| 日韩第一区第二区| 欧美日韩亚洲一区在线观看| 日韩在线理论| 亚洲一区久久| 婷婷久久国产对白刺激五月99| 在线视频亚洲欧美中文| 久久久久久久久久久久久久久久久久久久| 天堂√中文最新版在线| 久久国产精品久久w女人spa| 天天操综合520| 亚洲免费一区三区| 欧洲大片精品免费永久看nba| 免费在线欧美黄色| 亚洲www.| 中文字幕成在线观看| 亚洲综合不卡| 伊人情人综合网| 香蕉久久精品| 久久九九国产| 精品大片一区二区| 91蜜桃臀久久一区二区| 五月综合久久| 亚洲va久久| 国产videos久久| 91成人在线网站| 亚洲精品看片| 老司机午夜精品| 亚洲国产高清视频| 日韩午夜视频在线| 成人黄色免费观看| 成人在线中文| 国产精品蜜月aⅴ在线| 男女羞羞在线观看| 久久99久久99精品免观看软件| 91久久夜色精品国产按摩| 夜夜精品视频| 午夜亚洲性色视频| 视频一区欧美日韩| 欧美mv日韩| av资源中文在线| 亚洲精品mv| 91福利精品在线观看| 99久久精品一区二区成人| 日韩毛片一区| 一本综合精品| 亚洲国产一区二区三区高清 | 午夜亚洲性色福利视频| 一本久道久久综合婷婷鲸鱼| 国产一区成人| 色97色成人| 深夜在线视频| 国产成人福利夜色影视| 国产欧美一级| 欧美区日韩区| 国产乱码精品一区二区亚洲| 国产99久久| 久久夜色电影| 亚洲va久久久噜噜噜久久| 日韩欧美国产大片| 国产精品2023| 亚洲天堂偷拍| 媚黑女一区二区| 色偷偷色偷偷色偷偷在线视频| 天堂√8在线中文| 99精品热6080yy久久| 伊人久久大香伊蕉在人线观看热v| 99热这里有精品| 亚洲一级大片| 国产高清欧美| 日本一区二区在线看| 亚洲精品伦理| www.久久久久爱免| 成人爽a毛片| 先锋资源久久| av日韩中文| 久久影院亚洲| 久久久久毛片免费观看| 99精品美女| 成人一区不卡| 99精品免费| 精品三级国产| 亚洲一级网站| 国产伦子伦对白在线播放观看| 欧美一区在线看| 日韩伦理一区二区三区| 久久资源中文字幕| 国产精品论坛| 欧美日本一区| 99精品中文字幕在线不卡| 欧美日韩国产色综合一二三四| 色资源二区在线视频| 亚洲人成免费| 欧美成人专区| 久久久久久久高潮| 亚洲www免费| 高清久久精品| 婷婷激情久久| 丝袜诱惑一区二区| 亚洲青青久久| 国内精品福利| 国产成人精品亚洲日本在线观看| 欧美精品91| 久久久久国产| 日韩中文在线电影| 亚洲小说图片视频| 亚洲成人日韩| 国产精品资源| 一区二区中文字幕在线观看| 久久xxxx| 亚洲日本中文| 不卡一区2区| 草民电影神马电影一区二区| 亚洲黄页网站| 国产手机视频一区二区| 日本中文字幕一区| 美日韩黄色大片| 第四色男人最爱上成人网| 日韩一级淫片| 91麻豆国产自产在线观看亚洲| 欧州一区二区三区| 伊人久久大香线蕉综合热线| 美女性感视频久久| 另类在线视频| 成人国产精选| 老牛国内精品亚洲成av人片| 日韩电影免费网址| 66精品视频在线观看| h片在线观看视频免费| 日韩av中文字幕一区| 成人一级毛片| 日韩电影在线免费看| 蜜臀av性久久久久av蜜臀妖精| 成人久久精品| 裸体素人女欧美日韩| 国产不卡av一区二区| 国产精品美女久久久浪潮软件| 欧美激情 亚洲a∨综合| 亚洲激情成人| 国产精品日本一区二区不卡视频| 国产亚洲亚洲| 亚洲综合图色| 中文字幕高清在线播放| 91精品久久久久久综合五月天| 密臀av在线播放| 欧美日韩导航| 日韩精品久久久久久| 在线国产一区| 国产精品探花在线观看| 欧美好骚综合网| 欧美1区2区3| 亚洲黑人在线| 好看的亚洲午夜视频在线| 亚洲伦理精品| 性一交一乱一区二区洋洋av| 日韩a级大片| 99久久精品一区二区成人| 在线视频观看日韩| 亚洲精品护士| 美国毛片一区二区三区| 1204国产成人精品视频| 超碰这里只有精品| 婷婷亚洲最大| 亚洲美女久久| 欧美日韩女优| 99综合在线| 4438全国亚洲精品观看视频| 日韩成人一区| 久久亚洲国产精品一区二区| 红杏aⅴ成人免费视频| 日韩高清电影一区| 蜜臀91精品一区二区三区| 欧美私人啪啪vps| 亚洲精品婷婷| 欧美gv在线| 黄色成人91| 国产精品xxxav免费视频| 日韩福利视频网| 不卡福利视频| 91精品福利| 欧美精品中文字幕亚洲专区| 欧美日韩1区2区3区| 特黄毛片在线观看| 亚洲成人一区| 国产精品网址| 精品一区二区三区在线观看视频| 日韩免费一区| 午夜亚洲影视| 久久成人综合|