讲解CSP2151编程、辅导C++程序语言、c++编程辅导
讲解R语言编程|讲解数据库SQL
日期:2021-05-31 09:04
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:
“