首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
讲解CSP2151编程、辅导C++程序语言、c++编程辅导 讲解R语言编程|讲解数据库SQL
项目预算:
开发周期:
发布时间:
要求地区:
CSP2151 Assignment 2: A mini-programming project
General Information:
This assignment is an extension of the Workshops you have been doing during the semester.
Where appropriate, the standards set out in previous workshops should be followed and the
code must make good use of arrays, structures, and control flows, etc.
Assignment type: individual work (i.e., not a group assignment)
The tasks:
Design and implement (in C) the following tasks to complete and manage the robot combat
simulation.
Your program should first load the information of up to 10 robots from a file, named “Robot.txt”,
and store the information in an array of (structure of) robots. Use a variable, say robot_count, to
keep track of the number of robots stored in the array of robots.
To create a structure of robot for the robot combat simulation, you may refer to the structure of a robot that
you used in your Workshop 3, with an additional field, Best_score, that stores the highest score the robot has
ever achieved during a series of robot combat simulations. For example, you may define a new robot
structure with at least 6 fields, Robot_number, Robot_name, Year_manufactured, Top_speed, Mass,
Best_score. The Best_score field should be initialised 0.0 for all robots to indicate that no simulation has ever
been done to the individual robot. You may add any extra field/s as needed. The value of Best_score field
might be updated after any robot combat simulation.
The program then displays all available robot information stored in the array of robot (using a
tabular format). It then displays a Menu that allows the user to navigate through and execute
the following options:
1. Simulate a robot against a human opponent
2. Display simulation results
3. Display winners
4. Search a robot by robot_number or by robot_name
5. Input/update robot information
6. Save all results
7. Save robot information
8. Exit
2
Menu design/implementation requirement:
Create one function for each menu item (i.e., to implement its feature/s). If any of these functions was
not implemented as required in the final submission, use a dummy function that prints the following
statement only:
“
feature has not been completed yet.”
For example, if the “Save all results” feature was not completed at submission, the function should
print the following statement only:
“Save all results feature has not been completed yet.”
The “Simulate a robot against human opponents” feature should allow the user to select ONE
robot from the array of robots, and then simulate a robot combat against human opponents.
This feature can also be named “robot test”. The simulation result should be stored in the array
of structure created for the simulation result. The structure of the simulation results and of
robot simulation task are described in Section (1) and (2), see details in the next page).
The “Display simulation results” feature should allow the user to choose a robot by robot name
and display all simulation results of the robot (if any). If the robot has not yet been tested (i.e.,
no simulation was recorded), the program should display an error message, informing the user
that they must test that robot before displaying any results of the robot. If multiple robots have
the same name (e.g., each with a different robot number), all simulation results for robots with
that name should be displayed.
As a special case, if the robot name entered is “all”, the program should display the simulation
results of all robots that have been tested. If none of robots have been tested, an error message
should be displayed.
The “Display winners” feature should display an error message if no robot has been tested.
Otherwise it should display the top one robot in speed (one with highest speed), the top one
robot in strength and the top one robot in combat-effectiveness (i.e., a total of 3 results) of all
robots that have been tested.
The “Search a robot by robot_number or by robot_name” feature should allow the user to choose
to search for information of a robot either by Robot_number or by robot_name, say, by
providing a sub-menu:
1. Search by robot number
2. Search by robot name
In case the user chooses to search robots by robot number, the program searches the robot
from the array of robots based on value of the Robot_number field. If found successfully, the
information stored in the related entry/entries in the robot array will be displayed. Otherwise,
an error message should be displayed. As a special case, if the robot number entered is -1, it
displays information for all robots.
On the other hand, if the user chooses to search robots by robot name, the program does a
similar search, but it searches robot information by Robot_name field instead of Robot_number.
As a special case, if the robot name entered is “all”, it displays information for all robots.
The “Input/update robot information” feature allows the user to input or update information of
ONE robot. It prompts the user input a Robot_number. If the Robot_number entered matches an
existing robot, the information entered is used to update the information of the robot stored in
the array of robots. Otherwise a new entry should be created in the array of robots and
information be stored in the new entry (and the total number of robots should be increased).
3
The “Save all results” feature should display an error message if no robot has been tested.
Otherwise it creates a file, named “Results.txt”, and save the test results for all robots that have
been tested to that file.
The “Save robot information” feature should extract all robot information stored in the robot
array and save them back to the “Robot.txt” file for possible future tests. For simplicity, only the
first (up to) 10 pieces of information of robots are required to save.
(1) The data structures for robot simulation result
To save the robot simulation result, you should create an array of structure for the simulation
results and use it to save all simulations results. The simulation structure may have the following
fields (you may add extra fields as needed):
• Test ID
• Robot_number // or Robot_name?
• Finish_line_distance //Test conditions starts here
• Finish_line_time;
• Strength
• Test_score //combat_effectiveness -the test results
(2) Robot combat simulation
This task simulates a robot test scenario, completing calculations on various data items,
updating simulation results, and displaying test result.
At the start, the function/program prompts the user to choose ONE robot from the available
robots. It then prompts user to enter a variety of test conditions (including the
finish_line_distance, finish_line_time, and strength, of the robot ) for the robot
test/simulation.
Note:
A simulation of a robot combat simulation can be much more complicated in the real-world scenario,
as there would be many more variables to consider when designing such a system. We will only
design and implement a simplified version of such a system in this assignment.
Robot combat simulation can be done automatically (i.e., under random conditions: test data and
conditions are randomly generated within a reasonable value range), or manually (i.e., by entering a
set of test data or condition), or in a hybrid case (i.e., in a weighted combination of the above two
cases). - Due to time and workload constraints, we only perform a simulation manually in this
assignment (that is, simulation data and/or conditions are entered manually).
The test conditions are set as follows and must comply with the listed restrictions:
The test conditions are set as follows and must comply with the listed restrictions:
• finish_line_distance
o Measured in meters
o Must be in float data type, with value greater than or equal to 0.0
4
• finish_line_time
o Measured in second
o Must be in float data type, with value greater than 0.0
• strength
o Is the number of objects the robot can lift
o Must be in int data type, with value in the range from 0 to 100
If the user enters an invalid value for any test condition, the program should print an error
message, together with the data entered, and continue to prompt user again until a valid value is
entered.
Based on the information entered, the simulation calculates various data items, including speed
and combat_effectiveness of the robot participating the simulation. The simulation is done the
same way as that described in Workshop 2, plus the following additional task/s: Once completed
the simulation calculation, it then compares the current combat_effectiveness value with the
value stored in the Best_score field in the related entry of the robot array. If the current
combat_effectiveness value is greater than that entry value, it offers an opportunity for the user
to accept (thus to replace the Best_score of relevant robot/s) or discard the result.
Finally, it displays simulation result (together with test conditions) in a properly designed table.
An example table may look like:
Robot Test Result
Test ID (optional): (?)
Robot information:
Robot_number
Robot_name
Year_manufactured
Top_speed
Mass
Best_score
?
?
?
?
?
?
Test conditions:
finish_line_distance ?
finish_line_time ?
strength ?
Simulation result:
combat_effectiveness ?
where a question mark (“?”) is the value calculated (entered or taken from relevant array/s).
The program then offers the option of saving this output to the results array before starting
a new simulation or quitting.
(3) Some technical requirement for file I/O
File I/O should only be used when necessary. For example, file I/O should only be used in
the code part of implementing menu items 6 (i.e., Save all results) and 7 (i.e., Save robot
information), and at the very beginning when the program loads robot information into the
robot array. All other simulation operations should be done using value/s of variables,
arrays and/or structures in memory.
5
Bonus Mark (up to 4 marks):
Additional work and effort to improve the program and make it more useful can be worth bonus
marks. Bonus marks are not required and will not improve your grade above 100%. – Please do not
attempt tasks for bonus mark before you’ve attempted all required tasks of the assignment.
Examples of features that may be worth bonus marks:
• Advanced search features (search for all simulation/test results above a threshold value,
e.g., an input value)
• Use multiple files effectively with appropriate use of header files and good separation of
concerns.
• Graphical user interfaces, animations, or colours.
• Ask your tutor if you have any other ideas of improvement to the program!
(Note: To obtain the Bonus mark, a new version of C code should be submitted. That is: you need to submit
two versions of codes: one version only completed the required Assessable tasks without any work for Bonus
mark, and the other version serves as an advanced version that includes the work for the required Assessable
tasks together with the work for the bonus mark. For example, you may name your codes “Assignment2.c”
and “Assignment2_bonus.c”, respectively.)
NOTE: The Workshops have been working up to this point to provide you with a base program of
your own work that should give you the best possible opportunity for completing this assignment.
You should look to how these Workshops have developed your work for a guide on how to structure
your final assessment.
Design and coding requirements:
• The design: For this assignment, you can use either pseudocode or flowchart (but not mixed
using both) to complete the design. Your design file should contain separate designs for each
of your functions.
Please ensure that you include the information such as unit code, Assignment and number,
year and semester, and your name and student number, etc. in the header/footer area (or
somewhere else in the first page) of the Design file.
• The code: Your C code must be consistent with your design.
All printing for robot/s (and searching results etc.) on screen should use tabular format (e.g.,
the top line as a heading line, and lines following the heading line containing data items
only).
This is the major assignment of the unit, assessing your ability to solve problems and your
knowledge/skills in designing and implementing a medium-sized program based on a given
application scenario. You should use correct control structures (sequence, decisions, and
loops, functions, etc.) and appropriate or required data structures (arrays, strings, pointers,
files, etc.) to implement the program. The only Libraries to be used in this assignment are
,
,
,
,
,
, and
, together with
the only head files you created as a part of this assignment work, if any. Other non-standard
or any third-party libraries/packages should not be included/used in the code/s!
6
Academic Integrity and Misconduct
• This assignment is an individual work (not a teamwork). Your entire assignment must be your
own work (unless quoted otherwise) and produced for the current instance of the unit. Any
use of uncited content that was not created by you yourself constitutes plagiarism and is
regarded as Academic Misconduct. All assignments will be submitted to plagiarism checking
software, which compares your submission version with previous copies of the assignment,
and the work submitted by all other students in the unit (in the current semester or previous
years/semesters).
• Never give any part of your assignment to someone else, even after the due date or the
results are released. Do not work on individual assignment with other students. – You can
help someone by explaining concepts, demonstrating skills, or directing them to the relevant
resources. But doing any part of the assignment for them or with them or showing them your
work is inappropriate. An unacceptable level of cooperation between students on an
assignment is collusion and is deemed an act of Academic Misconduct. If you are not sure
about plagiarism, collusion or referencing, simply contact your lecturer or unit coordinator.
• You may be asked to explain and demonstrate your understanding of the work you have
submitted. Your submission should accurately reflect your understanding and ability to apply
the unit content and the skills learnt from this unit.
• Before submitting your assignment 2, make sure you have checked all items in the Academic
Integrity tick-before-submit checklist below and watch the video by clicking the link next to
the checklist image:
Watch this video before submitting your assignment
7
Indicative Marking Guide:
Criteria Available
Marks
You
mark
Design (flow controls, function design, etc.) /5
System menu and related functions (except for simulation part) /6
Simulation & calculation, etc. /3
File I/O /3
Code Legibility (formatting/indenting, comments, readability, etc.) /1
Data structures (array of structs, variables, etc.) /1
Program logic (flow controls, functions, data storage, efficiency) /5
Compiling /1
Executable and outputs /2
Overall (e.g., submission following Submission requirement, functionality
of the code/s, etc.)
/3
Bonus /5
Mark cut (e.g., global variables, breaking scope, use goto statement, etc.) (/-5)
Total: /30
Assignment Submission Requirements:
• You are required to submit through BB a .zip file containing at least four files:
(i) a design document (in Word or PDF format);
(ii) a C source code/s (in *.c format);
(iii) an executable code (in *.exe format); and
(iv) the text file, Robot.txt, that stores your pre-set robot information.
Your code should load information from this file when it starts running;
An additional C code (e.g., Assignment2_bonus.c), together with its corresponding executable
code, may also be included in the .zip file if you have attempted the work for bonus marks.
Again, unless specifically instructed, email or paper submission is not allowed.
• Please rename your .zip file as
CSP2151_Assignment3_
_< Your full name>.zip.
and submit the single .zip file only.
Note:
• Double check all documents/codes constianed in your submission/zip file and make sure they are the
correct version/s before submitting – It is recommended that you complie and run your code/s again
before submission, to avoid submitting incorrect file versions for marking.
• If you encounter any difficulties when submitting assignment solution through Blackboard, please
contact your tutor (Jitian, via j.xiao@ecu.edu.au or Kan, via k.yu@ecu.edu.au) and briefly explain the
difficulties you experienced (e.g., BB was down, BB doesn’t accept specific type of files, etc.).
• Please keep the copy of the assignment verion you submitted (in case your submission to BB was
corrupted and you may be requested to provide the same copy again).
8
Rubric
Not proficient Low Proficiency Developing
Proficiency
Moderate
Proficiency
High Proficiency Marks
Allocated
Design 0
Design not present or
does not meet
requirements
1
Design has logical flaws or
does not meet all
requirements
2-3
Design meets some requirements
but not all or has significant
formatting issues
4
Design meets most
requirements but has
some issues
5
Design meets all requirements
5
Menu items &
related functions
0
Menu/functions not
present
1
Two or less Menu
/functions present and are
poorly implemented
2-3
Up to four Menu/functions
implemented and work properly
4-5
Up to six Menu/functions
implemented and work
properly
6
All Menu/functions fully
implemented and work 6
Simulation&
calculation
0
Simulation
calculation not
present
1
Few calculations are
present, but do not work
2
Simulation calculation
are all present but
contain small errors.
3
Simulation calculation are
present and work as intended 3
File I/O 0
File I/O not present
1
File I/O not present but not
functional
2
File I/O present but has
some errors
3
Functions are present and
work as intended
3
Code Legibility 0
Code is very difficult
to read
1
Code is well written and
highly readable 1
Data structures 0
Struct, and array of
structs not used
1
Structs, array of structs fit to
purpose
1
Program logic 0
Functions and/or
arrays not present or
program is very
poorly structured
1
Few functions and/or
arrays are presented, or
program is very poorly
structured
2
Functions and/or arrays are
presented but program is poorly
structured
3-4
Functions and arrays are
present but with some
small issues of program
structure.
5
Program is well structured
5
Compiling 0
Code does not
compile
1
Code compiles with no
errors/warnings 1
Executable and
Output
0
Output is incorrectly
formatted, and no
executable code seen
1
Output is correct but could be
formatted better, executable code is
seen, with running issue
2
Executable is OK, Output is
correct and formatted
2
Overall 0
Requirement not
followed
1-2
All requirement not followed, and
code functions well
3
All requirement followed, and
code well functioned
3
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
urba6006代写、java/c++编程语...
2024-12-26
代做program、代写python编程语...
2024-12-26
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!