Computer Science; programming languages

Choose one of the enclosed tasks.
• The work is to be completed by 15 May for the relevant series.
• This document consists of 8 pages.
Turn over
© OCR 2020 [601/8355/X]
DC (KN) 192775/1
Oxford Cambridge and RSA
June 2020 and June 2021 series
GCSE (9–1) Computer Science
J276 Programming Project Tasks 1, 2 and 3
20 timetable hours
• Please check on the OCR website that you have
the material valid for the appropriate assessment
series.
OCR is an exempt Charity
2
© OCR 2020 J276 Jun20
Candidates should complete the task and provide evidence to meet all the criteria.
Candidates are required to select one scenario.
For the chosen scenario candidates must:
• analyse
• develop
• test and evaluate.
Test the final product and evaluate your solution against the detailed requirements you identified in the
analysis. This can be done using a suitable high level language such as:
• Python
• C family of languages (for example C# C++ etc.)
• Java
• JavaScript
• Visual Basic/.Net
• PHP
• Delphi
• SQL
• BASH
You may use a combination of programming languages to produce a solution to the task.
Please refer to the Programming Project Guidance on the OCR website for guidance on completing
the task.
3
© OCR 2020 J276 Jun20 Turn over
TASK 1
Noel is creating a music quiz game.
The game stores a list of song names and their artist
(e.g. the band or solo artist name). The player needs to
try and guess the song name.
The game is played as follows:
• A random song name and artist are chosen.
• The artist and the fi rst letter of each word in the song title are displayed.
• The user has two chances to guess the name of the song.
• If the user guesses the answer correctly the fi rst time, they score 3 points. If the user guesses
the answer correctly the second time they score 1 point. The game repeats.
• The game ends when a player guesses the song name incorrectly the second time.
Only authorised players are allowed to play the game.
Where appropriate, input from the user should be validated.
Design, develop, test and evaluate a system that:

  1. Allows a player to enter their details, which are then authenticated to ensure that they are an
    authorised player.
  2. Stores a list of song names and artists in an external file.
  3. Selects a song from the file, displaying the artist and the first letter of each word of the song title.
  4. Allows the user up to two chances to guess the name of the song, stopping the game if they guess
    a song incorrectly on the second chance.
  5. If the guess is correct, add the points to the player’s score depending on the number of guesses.
  6. Displays the number of points the player has when the game ends.
  7. Stores the name of the player and their score in an external file.
  8. Displays the score and player name of the top 5 winning scores from the external file.
    4
    © OCR 2020 J276 Jun20
    TASK 2
    Katarina is developing a two-player dice game.
    The players roll two 6-sided dice each and get points depending on what they
    roll. There are 5 rounds in a game. In each round, each player rolls the two dice.
    The rules are:
    • The points rolled on each player’s dice are added to their score.
    • If the total is an even number, an additional 10 points are added to their score.
    • If the total is an odd number, 5 points are subtracted from their score.
    • If they roll a double, they get to roll one extra die and get the number of points rolled added to
    their score.
    • The score of a player cannot go below 0 at any point.
    • The person with the highest score at the end of the 5 rounds wins.
    • If both players have the same score at the end of the 5 rounds, they each roll 1 die and
    whoever gets the highest score wins (this repeats until someone wins).
    Only authorised players are allowed to play the game.
    Where appropriate, input from the user should be validated.
    Design, develop, test and evaluate a program that:
  9. Allows two players to enter their details, which are then authenticated to ensure that they are
    authorised players.
  10. Allows each player to roll two 6-sided dice.
  11. Calculates and outputs the points for each round and each player’s total score.
  12. Allows the players to play 5 rounds.
  13. If both players have the same score after 5 rounds, allows each player to roll 1 die each until
    someone wins.
  14. Outputs who has won at the end of the 5 rounds.
  15. Stores the winner’s score, and their name, in an external file.
  16. Displays the score and player name of the top 5 winning scores from the external file.
    5
    © OCR 2020 J276 Jun20
    TASK 3
    Louise is creating a card game for two players.
    The game uses a deck of cards. There are 30 cards in a deck.
    Each card has one colour (red, black or yellow). Each card has
    a number (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) for each colour. Each card
    is unique.
    The 30 cards are shuffled and stored in the deck.
    The rules are:
    • Player 1 takes the top card from the deck.
    • Player 2 takes the next card from the deck.
    • If both players have a card of the same colour, the player with the highest number wins.
    • If both players have cards with different colours, the winning colour is shown in the table.
    Card Card Winner
    Red Black Red
    Yellow Red Yellow
    Black Yellow Black
    • The winner of each round keeps both cards.
    • The players keep playing until there are no cards left in the deck.
    Only authorised players are allowed to play the game.
    Where appropriate, input from the user should be validated.
    Design, develop, test and evaluate a program that:
  17. Allows two players to enter their details, which are then authenticated, to ensure that they are
    authorised players.
  18. Shuffles the 30 cards in the deck.
  19. Allows each player to take a card from the top of the deck. Play continues until there are no cards
    left in the deck.
  20. Calculates the winner and allocates both cards to the winner.
  21. Displays which player wins (the player with the most cards).
  22. Lists all of the cards held by the winning player.
  23. Stores the name and quantity of cards of the winning player in an external file.
  24. Displays the name and quantity of cards of the 5 players with the highest quantity of cards from
    the external file.
    6
    © OCR 2020 J276 Jun20
    BLANK PAGE
    7
    © OCR 2020 J276 Jun20
    BLANK PAGE
    8
    © OCR 2020 J276 Jun20
    Oxford Cambridge and RSA
    Copyright Information
    OCR is committed to seeking permission to reproduce all third-party content that it uses in its assessment materials. OCR has attempted to identify and contact all copyright holders
    whose work is used in this paper. To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced in the OCR Copyright
    Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download from our public website (www.ocr.org.uk) after the live examination series.
    If OCR has unwittingly failed to correctly acknowledge or clear any third-party content in this assessment material, OCR will be happy to correct its mistake at the earliest possible
    opportunity.
    For queries or further information please contact The OCR Copyright Team, The Triangle Building, Shaftesbury Road, Cambridge CB2 8EA.
    OCR is part of the Cambridge Assessment Group; Cambridge Assessment is the brand name of University of Cambridge Local Examinations Syndicate (UCLES), which is itself a
    department of the University of Cambridge.

Sample Solution

ACED ESSAYS