国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女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色精品视频| 一本色道久久99精品综合| 国产美女精品在线观看| 国产精品成av人在线视午夜片| 黄色一级视频播放| 国产精品美女主播| 国产主播在线看| 精品丰满人妻无套内射| 国产欧美在线一区| 中文字幕免费高| 操人视频欧美| 亚洲中文字幕无码中文字| 俄罗斯精品一区二区三区| 欧美巨猛xxxx猛交黑人97人| 国产乱子伦精品| 中文字幕一区综合| 97欧洲一区二区精品免费| 亚洲精品第一区二区三区| 久久男人资源站| 欧美中文字幕在线视频| 久久久黄色av| 国产日韩精品推荐| 中文字幕一区二区三区四区五区六区 | 97久久精品国产| 亚洲国产欧美一区二区三区不卡| 91好吊色国产欧美日韩在线| 日本一区二区三区免费观看 | 亚洲福利av在线| 国产不卡视频在线| 欧美在线中文字幕| 国产精品观看在线亚洲人成网| 国产一区免费| 亚洲一区二区免费在线| 久久99国产精品一区| 秋霞午夜一区二区| 国产精品久久97| 成人免费视频a| 日韩女优人人人人射在线视频| 国产精品视频导航| 国产伦精品一区二区三区| 日韩一级片播放| 国产精品视频入口| 毛片精品免费在线观看| 国产精品69av| 欧美 国产 日本| 精品国产乱码久久久久软件| 2019日本中文字幕| 欧美精品亚洲| 欧美激情久久久久| 久久综合久久久久| 欧美精品七区| 亚洲一区精品电影| 俺也去精品视频在线观看| 国产欧美一区二区三区不卡高清| 亚洲国产精品久久久久爰色欲| 色婷婷av一区二区三区久久| 国产伦精品一区二区三区四区免费 | 国产精品一区二区久久久| 肉大捧一出免费观看网站在线播放| 国产mv久久久| 国产欧美日韩一区| 日韩欧美三级一区二区| 久久99热精品这里久久精品| 久久久综合av| 国产欧美在线播放| 日av中文字幕| 欧美精品久久久久久久| 日韩三级成人av网| 国产伦精品一区二区三区高清 | 成人免费无码av| 欧美亚洲国产日韩2020| 亚洲一区二区三区色| 久久精品在线播放| 久久久免费视频网站| 国产欧美一区二区三区久久| 欧美在线性视频| 午夜免费日韩视频| 欧美激情日韩图片| 国产精品日韩欧美一区二区| 国产a视频免费观看| 97人人爽人人喊人人模波多| 国产又黄又大又粗视频| 日韩精品久久一区二区| 亚洲综合在线做性| 九九综合九九综合| 国产精品天天狠天天看| 久久免费成人精品视频| 成人精品一区二区三区电影黑人 | 欧洲视频一区二区三区| 大波视频国产精品久久| 一区二区免费电影| 欧美情侣性视频| 国产精品久久久久秋霞鲁丝| 国产黄页在线观看| 99高清视频有精品视频| 国产日韩成人内射视频| 蜜桃麻豆www久久国产精品| 欧美自拍资源在线| 日韩美女在线观看| 日韩欧美一区二区三区四区| 欧美一级片免费在线| 亚洲精品女av网站| 亚洲精品免费在线看| 一区二区精品视频| 亚洲国产精品日韩| 一区二区三区免费看| 色综合老司机第九色激情| 国产精品国产三级国产专区53 | 精品国产一区二区三区四区精华| 国产精品视频网址| 久久久99免费视频| 国产精品入口福利| 国产精品久久网| 国产精品福利观看| 精品国产一区二区三区日日嗨| 国产精品久久久久9999爆乳| 国产精品免费观看高清| 国产精品精品视频| 欧美精品免费看| 欧美激情精品久久久久久久变态| 精品国偷自产一区二区三区| 国产精品极品尤物在线观看| 国产精品传媒毛片三区| 精品久久久久久无码中文野结衣| 精品国产第一页| 中文字幕一区二区三区乱码 | 操日韩av在线电影| 欧美精品做受xxx性少妇| 欧美日韩第一视频| 亚州精品天堂中文字幕| 日本一区二区三区www| 青青草综合在线| 欧美最猛性xxxxx(亚洲精品)| 欧美精品亚洲精品| 国产在线观看一区二区三区| 国产精品永久免费| av网址在线观看免费| 97人人模人人爽人人喊中文字| 久久久亚洲精品无码| 俺也去精品视频在线观看| 国产精品久久久久影院日本| 欧美日本亚洲视频| 亚洲 欧洲 日韩| 欧美亚洲色图视频| 国产深夜精品福利| 91精品视频在线| 日韩视频免费在线观看| 久久成人在线视频| 亚洲激情一区二区| 欧美在线一二三区| 国产精品自拍首页| 久久av一区二区三区亚洲| 国产精品久久久久久久久久东京| 亚洲最大福利视频| 青青草原av在线播放| 国产日本在线播放| 久久国产精品免费观看| 久久成人在线视频| 丁香六月激情婷婷| 国内免费久久久久久久久久久| 风间由美一区二区三区| 国产精品1区2区在线观看| 日韩亚洲在线观看| 在线视频欧美一区| 欧美中文字幕第一页| 国产情侣av自拍| 久艹在线免费观看| 亚洲午夜精品久久久久久人妖| 日韩暖暖在线视频| 国产欧美一区二区三区久久人妖| 国产高清av在线播放| 久久成人18免费网站| 婷婷五月色综合| 国产日韩亚洲欧美在线| 国产av无码专区亚洲精品| 久久资源免费视频| 青青a在线精品免费观看| 国产一区国产精品| 久久久久女教师免费一区| 亚洲永久在线观看| 黄色国产精品一区二区三区| 久久久在线观看| 欧美激情精品久久久久久黑人| 欧美日韩一区二区三| 91精品国产乱码久久久久久久久 | 麻豆乱码国产一区二区三区| 亚洲 中文字幕 日韩 无码| 国产网站免费在线观看| 国产精品九九久久久久久久| 欧美国产二区| 国产精品精品视频| 美女被啪啪一区二区| 国产精品后入内射日本在线观看|