CSP1150D Programming Principles
Assignment: Individual Programming assignment (“Guessing Game”)
Assignment Marks: Marked out of 20, (20% of unit result)
Background Information
This assignment tests your understanding of and ability to apply the programming concepts we have
covered in the unit so far, including the usage of variables, input/output, data types, selection,
iteration,functionsanddatastructures.
Pseudocode
As emphasised in the case study of Module 5, it is important to take the time to properly design a
solution before starting to write code. Hence, this assignment requires you to write and submit
pseudocode of your program design as well as the code for the program. Furthermore, while your
tutors are happy to provide help and feedback on your assignment work throughout the semester,
they will expect you to be able to show your pseudocode and explain the design of your code. Write
a separate section of pseudocode for each function in your program.
Assignment Requirements
You are required to design and implement a “Guessing Game” program that generates a random
choice and prompts the user to choose. The program determines the winner, reports result to the
user and stores number of wins. The program will have multiple levels of difficulty. At the end of the
program itwill displaythe resultsforthe user.
Implementall of the followingrequirements,andaskyourtutor if youdo not understandanyof the
requirements.
1. The program shouldwelcome the userandpromptthemtochoose Easy, MediumorHard.
2. Re-promptthe useruntil avalidresponse (1,2 or 3) is entered.Once adifficultyhasbeen
chosen,printa message toconfirmthe selecteddifficultyandset a variable asfollows:
3. The program shouldthenloopa numberof timesequal to rounds.
a. The program should then randomly choose ‘rock’, ‘paper’ or ‘scissors’. Use a
function toget the choice andreturn itto the program.
b. The user should then be asked to choose between ‘rock’, ‘paper’ or ‘scissors’.
Another function should be used to return the users choice. If the user chooses
somethingotherthanrock,paperor scissorstheyshouldbe askedtore-enter.
c. The program will determine winner and display who won. A third function should do
this– make sure youcan counthow many wins.
Welcome toRock PaperScissors.
SelectDifficulty:
1) Easy
2) Medium
3) Hard
>
Easy: rounds= 3
Medium: rounds= 5
Hard: rounds= 10
4. Once the user has completed the number of rounds the program should display the results.
Then the program will ask the user if they would like to try again and redisplay the difficulty
menuand runagain if theyenteryes.
Remember:Rock> Scissors> Paper> Rock …
Submission of Deliverables
Once your assignment is complete, submit both your pseudocode (PDF or DOC format – no .pages
files) and source code (“.py” file) to the appropriate location on moodle. You will need to create a
ZIP file (NOT RAR, ARJ or other archive) and submit the one file. An assignment cover sheet is not
required,butbe sure to include your name and student numberat the top of both files.
Referencing, Plagiarism and Collusion
The entirety of your assignment must be your own work (unless otherwise referenced) and
produced for the current instance of the unit. Any use of unreferenced content you did not create
constitutes plagiarism, and is deemed an act of academic misconduct. All assignments will be
submitted to plagiarism checking software which includes previous copies of the assignment.
Remember that this is an individual assignment. Never give anyone any part of your assignment –
even after the due date or after results have been released. Do not work together with other
students on individual assignments – helping someone by explaining errors in their code/logic or
directing them to the relevant resources is appropriate, but doing it for them or showing them how
you did it is not. An unacceptable level of cooperation between students on an assignment is
collusion, and is deemed an act of academic misconduct. If you are uncertain about plagiarism,
collusionorreferencing,simplyemail yourtutor,lecturerorunitcoordinator andask.
Marking Key
Marks are allocatedasfollowsforthisassignment. Criteria Marks
Pseudocode
These marks are awarded for submittingpseudocode/flowcharts which suitably representthe
design of your sourcecode. Pseudocode and flowcharts will beassessed on the basis of “does it
help in understanding/describingthestructure and flowof the program?”
5
Functionality
These marks are awarded for submittingsource code that implements the requirements specified
in this brief. Code which is not functional or contains syntax errors will losemarks,as will failingto
implement requirements as specified.
10
Code Quality
These marks are awarded for submittingwell-written sourcecode that is efficient, well-formatted
and demonstrates a solid understandingof the concepts involved. This includes appropriateuseof
commenting and adheringto best practise.
5
Total: 20

CSP1150D Programming Principles

  • 1.
    CSP1150D Programming Principles Assignment:Individual Programming assignment (“Guessing Game”) Assignment Marks: Marked out of 20, (20% of unit result) Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered in the unit so far, including the usage of variables, input/output, data types, selection, iteration,functionsanddatastructures. Pseudocode As emphasised in the case study of Module 5, it is important to take the time to properly design a solution before starting to write code. Hence, this assignment requires you to write and submit pseudocode of your program design as well as the code for the program. Furthermore, while your tutors are happy to provide help and feedback on your assignment work throughout the semester, they will expect you to be able to show your pseudocode and explain the design of your code. Write a separate section of pseudocode for each function in your program. Assignment Requirements You are required to design and implement a “Guessing Game” program that generates a random choice and prompts the user to choose. The program determines the winner, reports result to the user and stores number of wins. The program will have multiple levels of difficulty. At the end of the program itwill displaythe resultsforthe user. Implementall of the followingrequirements,andaskyourtutor if youdo not understandanyof the requirements. 1. The program shouldwelcome the userandpromptthemtochoose Easy, MediumorHard. 2. Re-promptthe useruntil avalidresponse (1,2 or 3) is entered.Once adifficultyhasbeen chosen,printa message toconfirmthe selecteddifficultyandset a variable asfollows: 3. The program shouldthenloopa numberof timesequal to rounds. a. The program should then randomly choose ‘rock’, ‘paper’ or ‘scissors’. Use a function toget the choice andreturn itto the program. b. The user should then be asked to choose between ‘rock’, ‘paper’ or ‘scissors’. Another function should be used to return the users choice. If the user chooses somethingotherthanrock,paperor scissorstheyshouldbe askedtore-enter. c. The program will determine winner and display who won. A third function should do this– make sure youcan counthow many wins. Welcome toRock PaperScissors. SelectDifficulty: 1) Easy 2) Medium 3) Hard > Easy: rounds= 3 Medium: rounds= 5 Hard: rounds= 10
  • 2.
    4. Once theuser has completed the number of rounds the program should display the results. Then the program will ask the user if they would like to try again and redisplay the difficulty menuand runagain if theyenteryes. Remember:Rock> Scissors> Paper> Rock … Submission of Deliverables Once your assignment is complete, submit both your pseudocode (PDF or DOC format – no .pages files) and source code (“.py” file) to the appropriate location on moodle. You will need to create a ZIP file (NOT RAR, ARJ or other archive) and submit the one file. An assignment cover sheet is not required,butbe sure to include your name and student numberat the top of both files. Referencing, Plagiarism and Collusion The entirety of your assignment must be your own work (unless otherwise referenced) and produced for the current instance of the unit. Any use of unreferenced content you did not create constitutes plagiarism, and is deemed an act of academic misconduct. All assignments will be submitted to plagiarism checking software which includes previous copies of the assignment. Remember that this is an individual assignment. Never give anyone any part of your assignment – even after the due date or after results have been released. Do not work together with other students on individual assignments – helping someone by explaining errors in their code/logic or directing them to the relevant resources is appropriate, but doing it for them or showing them how you did it is not. An unacceptable level of cooperation between students on an assignment is collusion, and is deemed an act of academic misconduct. If you are uncertain about plagiarism, collusionorreferencing,simplyemail yourtutor,lecturerorunitcoordinator andask. Marking Key Marks are allocatedasfollowsforthisassignment. Criteria Marks Pseudocode These marks are awarded for submittingpseudocode/flowcharts which suitably representthe design of your sourcecode. Pseudocode and flowcharts will beassessed on the basis of “does it help in understanding/describingthestructure and flowof the program?” 5 Functionality These marks are awarded for submittingsource code that implements the requirements specified in this brief. Code which is not functional or contains syntax errors will losemarks,as will failingto implement requirements as specified. 10 Code Quality These marks are awarded for submittingwell-written sourcecode that is efficient, well-formatted and demonstrates a solid understandingof the concepts involved. This includes appropriateuseof commenting and adheringto best practise. 5 Total: 20