CCN2042 Computer Programming

CCN2042 Computer Programming
Group Project – Cooking Game
(Due: 23:59, 18 Apr 2019 (week 12 before Easter))
Expected Learning Outcomes
familiarise themselves with at least one high level language programming environment.
develop a structured and documented computer program.
understand the fundamentals of object-oriented programming and apply it in computer
program development.
apply the computer programming techniques to solve practical problems.
Introduction
In this assignment, you are going to develop the Cooking Game, a game that runs in the
command line environment. The player needs to rapidly prepare and serve the burgers within
a time limit.
This is a group assignment. You need to form a group with 5 to 6 students and write a
Win32 Console Application program called CookGame.cpp. The requirements are listed
below.
System Requirements
R0 When the program starts, the console should display a welcome message, and then
the Game Menu of the program. User can enter the options of the corresponding
actions (see R1 to R6 below).
Welcome Message designed by your group
*** Game Menu ***
[1] Start Game
[2] Settings
[3] Burger Menus
[4] Instructions
[5] Credits
[6] Exit
*****************
Option (1 - 6):

CCN2042 18-19 Semester 2 – Group Project 2
R1 [1] Start Game
When the user inputs 1 in the Game Menu, the game starts with the current game
settings (see R2).
Initially, the order list will be shown in the console. Each order contains the following
information:
1. Type of burgers (See R1.2)
2. Cooking status (See R1.3)
3. Remaining time (in form of m’ss”)
The initial number of orders will be randomly generated, and limited to the max
number of order set in the game settings.
All the burgers’ initial status is "preparing", and the remaining time is 40 seconds
(time limit can be set in the game settings, see R2).
The initial score is 10.
A sample game starts as follow, where the order list is randomly generated:
*** Order list ***
Order #1: Cheese burger, preparing, 0’40”
Order #2: Beef burger, preparing, 0’40”
Order #3: Cheese burger, preparing, 0’40”
Order #4: mushroom burger, preparing, 0’40”
Order #5: salmon burger, preparing, 0’40”
-----------------------------------------------
Score: 10
Enter [U] for update, [Q] for Quit, or [1-5] for order:
Player can input the order number to process the order.
Player can input ‘u’ or ‘U’ to refresh the order list for updating the information (i.e.
cooking status and remaining time) of all orders.
Player can input ‘q’ or ‘Q’ to quit the current game and return to the game menu.
R1.1 Order list
The orders will be shown with the type of burgers, cooking status and the remaining
time. The order list may not be in chronological order, such as:
Order #1: Cheese burger, preparing, 0‘40"
Order #2: Beef burger, cooking, 0‘35"
Order #3: Cheese burger, cooking, 0‘20"
Order #4: mushroom burger, ready to serve, 0‘09"
Order #5: salmon burger, preparing, 0‘38"
Order #6: salmon burger, preparing, 0‘40"
CCN2042 18-19 Semester 2 – Group Project 3
R1.2 Type of burgers
There are five types of burgers with different ingredients in a specific order and
different cooking time (in second):
Type of burgers Ingredients orders Cooking time
Cheese burger Bread, cheese, beef, lettuce, bread 10
Beef burger Bread, cheese, tomato, beef, lettuce, bread 10
Mushroom burger Bread, cheese, beef, mushroom, bread 15
Veggie burger Bread, tomato, egg, lettuce, bread 10
Salmon burger Bread, cheese, beef, salmon, bread 15
There are eight types of ingredients, symbols are shown as follow:
Ingredients Symbol Ingredients Symbol
Bread B/b Tomato T/t
Cheese C/c Mushroom M/m
Beef F/f Egg E/e
Lettuce L/l Salmon S/s
R1.3 Cooking Status
Each burger has to go through 3 statuses to complete: preparing, cooking and
ready to serve.
Status: preparing
The initial status of a burger is "preparing".
Player can input the order number to choose the order with status "preparing".
Then the “Process Order” page will be shown, for example:
*** Process Order ***
Order # : 1
Burger : Cheese Burger
Status : preparing
Remaining Time : 1‘53"
Burger Ingredient List: [B]read, [C]heese, Bee[f], [L]ettuce, [B]read
Burger Key List : bcflb
Please choose [U] for update, [R] for return, or
type correct key list to start cooking:
Player can input ‘u’ or ‘U’ to refresh the remaining time of the order.
Player can input ‘r’ or ‘R’ to return to the order list.
Player needs to type the correct order of ingredient symbols as specified in R1.2. For
example, cheese burger as shown above, player needs to input: bcflb
CCN2042 18-19 Semester 2 – Group Project 4
If the input is incorrect, an error message is displayed. Then the “Process Order”
page is refreshed with updated remaining time. And the player needs to input again.
If the input is correct, the system returns to the order list. The status of that order is
changed to "cooking".
Player can continue to choose other orders to process.
Status: cooking
When the burger is in the "cooking" status, the player has to wait until it is done.
Concurrently, the player can choose other order to process.
If the player chooses the order with status "cooking", message should be prompted
to the player to let him/her know that the burger is not yet done.
Each burger needs to be cooked with the cooking time specified in R1.2. For example,
cheese burger needs to be cooked for 10 seconds.
If the burger is cooked, the status of the burger will be changed from "cooking" to
"ready to serve".
Status: ready to serve
Player can choose the order with status "ready to serve".
Then the burger will be served and the order will be removed from the order list. 10
marks will be awarded.
R1.4 Time limit
There is a time limit for each order, which is the same for all types of burger and can
be set in the game settings (see R2).
The orders need to be served before the time limit is reached.
The remaining time shown in the order list will be updated every time the order list is
refreshed, e.g. player inputs ‘u’ or ‘U’ to update the order list, an order is served, or
the program returns from the “process order” page.
If the player failed to serve the burger within the time limit, the order will be removed
from the order list. 5 marks will be deducted.
R1.5 New order generation
New orders (can be more than one order) may be added to the order list whenever the
order list is refreshed, e.g. player inputs ‘u’ or ‘U’ to update the order list, an order is
served, or the program returns from the “process order” page.
New orders are generated randomly with a certain probability (upon your design).
CCN2042 18-19 Semester 2 – Group Project 5
R1.6 Game rules / Scoring
When the game starts, the player will initially have 10 marks.
If the order is served on time, 10 marks will be awarded.
When the order cannot be served within the time limit, 5 marks will be deducted.
The game finishes when the score < 0. If the game finishes, the system should notice
the player, and the program returns to the Game Menu.
R1.7 Quit the game
Player can input ‘q’ or ‘Q’ in the order list page to quit the game. If this happens, the
system should prompt for player’s confirmation. If the player inputs ‘y’ or ‘Y’, the
game ends and the system returns to the Game Menu. If the player inputs ‘n’ or ‘N’,
the game continues at its current status. Other input is not acceptable and the system
should ask the player to confirm again.
R2 [2] Settings
When the user inputs 2 in the Game Menu, the console displays the Settings Menu
with current setting. User can enter the options of the corresponding actions (see R2.1
to R2.3 below).
*** Settings Menu ***
[1] Time limit [40 sec]
[2] Max number of orders [5]
[3] Return to Game Menu
*********************
Option (1 - 3):
After each setting is done, the system should remain at the Setting Menu until the user
chooses option 3 to return.
R2.1 [1] Time limit (default: 40 seconds)
When the user inputs 1 in the Settings Menu, the console displays the current game
setting of time limit for the orders, and prompts for the user input of the new value.
Note that the time limit is in the unit of second and should not be greater than 300
seconds (5 mins).
After the setting is updated, the new setting should be displayed and the system
returns to the Settings Menu.
CCN2042 18-19 Semester 2 – Group Project 6
R2.2 [2] Max number of orders (default: 5 orders)
When the user inputs 2 in the Settings Menu, the console displays the current game
setting of the max number of order, and prompts for the user input of the new value.
Note that acceptable max number of order is 1 to 50.
After the setting is updated, the new setting should be displayed and the system
returns to the Settings Menu.
R2.3 [3] Return to Game Menu
When the user inputs 3 in the Settings Menu, the system returns to the Game Menu.
R3 [3] Burger Menu
When the user inputs 3 in the Game Menu, the console displays the Burger Menu.
User can enter the options of the corresponding actions (see R3.1 to R3.3 below).
**** Burger Menu *****
[1] Types of Burger
[2] Ingredient Symbols
[3] Return to Game Menu
*********************
Option (1 - 3):
After a particular information is displayed, the system should remain at the Burger
Menu until the user chooses option 3 to return.
R3.1 [1] Types of Burger
Display all types of burger, their ingredients and the cooking time (see R1.2). Then
the system returns to the Burger Menu.
R3.2 [2] Ingredient Symbols
Display all ingredients and the corresponding symbols (see R1.2). Then the system
returns to the Burger Menu.
R3.3 [3] Return to Game Menu
When the user inputs 3 in the Burgers Menu, the system returns to the Game Menu.
CCN2042 18-19 Semester 2 – Group Project 7
R4 [4] Instructions
The system displays the instructions for playing the Cooking game. After displaying
the instruction, the system returns to the Game Menu.
R5 [5] Credits
The system displays the personal particulars (e.g. student name, student ID, class,
tutorial group, etc.) of the group members. After displaying the information, the
system returns to the Game Menu.
R6 [6] Exit
When the user inputs this option, the system prompts for user’s confirmation. If the
user inputs ‘y’ or ‘Y’, the program terminates. If the user inputs ‘n’ or ‘N’, the system
returns to the Game Menu. Other input is not acceptable and the system should ask
the user to confirm again.
Other General Requirements
R7 Meaningful guidelines should be printed to assist with user’s input. Whenever an
option is selected, meaningful messages should be displayed.
R8 Suitable checking on user’s input is expected. Appropriate error messages should be
printed whenever unexpected situation happens, e.g., invalid input, input out-of-range,
etc.
R9 The use of functions (in addition to main function) and classes are expected in your
program. Appropriate comments should be added in your source code file.
R10 Creativity and Critical Thinking: other features that you find useful (such as the
“intelligence of computer player”) or can enhance the user experience can also be
implemented.
Submission
Source File: Each group has to submit one source code file (i.e., CookGame.cpp) that
implements this group project.
Peer-to-peer Evaluation: Each student has to fill in and submit the peer-to-peer evaluation
form (i.e., CCN2042_P2P_Evaluation.docx) for your group.
CCN2042 18-19 Semester 2 – Group Project 8
All submission should be done through Moodle by 23:59, 18 April 2019. Late submission is
subject to 20% deduction in your final marks for each day (including public holidays and
Sundays). No late submission is allowed 4 days after the due date.
Grading criteria
Aspects Percentage
Program correctness
(Follow ALL instructions, marks deduction on errors found)
70%
Program design
(Appropriate use of functions, use of class, modularity, etc.)
10%
Program standard
(Use of variable names, indentation, line spacing, clarity, comments, etc.)
5%
Algorithm design
(Use of reasonable algorithms and data structures)
5%
User-friendliness
(Clear guidelines to users, messages to users, etc.)
5%
Creativity and critical thinking
(Additional useful features)
5%
Total (Group Mark) 100% (max)
Note: the length of your program does not affect the grading of the assignment. However,
appropriate use of loops and functions are expected to avoid too many repeated codes in your
program, which contributes to the program design score of this assignment.
Individual mark is determined by both group mark (80%) and individual contribution (20%),
where individual contribution is directly proportion to the average marks given by group
members in the peer-to-peer evaluation form.
Marks deduction
Marks will be deducted if the program fails to be compiled. The deduction is from 5 to 20
marks, depending on how serious the syntax error is. Note that if the program contains
unacceptably too many serious syntax errors, your program will score 0 marks.
Syntax errors also lead to failure in the program correctness if the function cannot be tested.
So please make sure that your program can be compiled successfully before your submission.
CCN2042 18-19 Semester 2 – Group Project 9
Tips
To refresh the console screen, you may use the following windows platform command
appropriately in your program:
system("cls"); // Clear everything on the screen
system("pause"); // Wait until user pressing any key to continue
To handle unexpected input error (e.g. input a character to an integer variable), you may use
the following code appropriately in your program:
cin.ignore(); // Discard the content in the input sequence
cin.clear(); // Reset the input error status to no error
** Ensure the originality of your work. Plagiarism in any form is highly prohibited. **
- End -

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

微信:codinghelp

原文地址:https://www.cnblogs.com/helpyourjava/p/10595486.html

时间: 2024-11-07 16:54:44

CCN2042 Computer Programming的相关文章

K老在拿图灵奖时的发言:Computer Programming as an Art

很多话说得很透彻,把一些觉比较精彩的摘抄一下.... It seems to me that if the authors I studied were writing today, they would agree with the following characterization: Science is knowledge which we understand so well that we can teach it to a computer; and if we don't ful

MTH5001: Introduction to Computer Programming

projectMarch 14, 20191 MTH5001: Introduction to Computer Programming 2018/191.1 Final Report Project: "Networks"1.1.1 Instructions:First, please type your name and student number into the Markdown cell below:Name:Student number:You must write yo

ISOM 3029 - Computer Programming Using C++

University of MacauFaculty Of Business AdministrationISOM 3029 - Computer Programming Using C++ 2019/2020 (First Semester)Assignment 1Due date: October 11, 2019 (before 5pm)Submitted to: Ms YunYun Zhou (GA) Instructions:?Read the Assignment Requireme

CS2313 Computer Programming

CS2313 Computer ProgrammingAssignment OneDeadline: 2019-Nov-16 11:59pmLate submission: 70% (within 24hrs after the deadline), 0% (after 24hrs)1. Problem descriptionA “lucky sequence” is the sequence of numbers where every number after the first twois

Reflection (computer programming) -反射

n computer science, reflection is the ability of a computer program to examine, introspect, and modify its own structure and behavior at runtime.[1] A language supporting reflection provides a number of features available at runtime that would otherw

Teach Yourself Programming in Ten Years

Teach Yourself Programming in Ten Years Peter Norvig Why is everyone in such a rush? Walk into any bookstore, and you'll see how to Teach Yourself Java in 24 Hours alongside endless variations offering to teach C, SQL, Ruby, Algorithms, and so on in

Important Programming Concepts (Even on Embedded Systems) Part V: State Machines

Earlier articles in this series: Part I: Idempotence Part II: Immutability Part III: Volatility Part IV: Singletons Oh, hell, this article just had to be about state machines, didn’t it? State machines! Those damned little circles and arrows and q’s.

glob (programming) and spool (/var/spool)

http://en.wikipedia.org/wiki/Glob_(programming) In computer programming, in particular in a Unix-like environment, the term globbing is sometimes used to refer to pattern matching based on wildcard characters.[citation needed] The noun "glob" is

10 ways to improve your programming skills

http://rudyn.is-programmer.com/ 1. Learn a newprogramming language学习一门新的编程语言 Learning new programming languages will expose you to new ways ofthinking; especially if the new language uses a paradigm which you aren't yetfamiliar with. Many of the ways