Designing and Developing Object-Oriented Computer Programs : Language Trainer
Introduction
The mind is like any part of the body – it needs exercise to stay healthy. There are many
cognitive training regimes that exist for that, but one of the most effective for memory is
the game known as ‘concentration’. In this game, fifty-two cards are laid face down on a
table. Each player takes a turn flipping over a card and then attempting to flip over a
second card with the same colour and value. For example, if we flip over the five of hearts
we would want to flip over the five of diamonds as our secondary selection. If we make a
match, the cards are removed and added to our score. If they don’t match, they are flipped
back face down and the other player is given an opportunity to flip two matching cards.
Players continue taking turns until all cards have been matched.
This is a powerful technique for training observational faculties and short-term memory,
and it’s your job for this assessment to write a piece of software that implements this
system with a difference – you’ll be looking to match English words and their translation for
several languages (two for the purposes of this assessment). For example, we might want
to match the English word ‘Hot’ with the French word ‘chaud’. For the purposes of this
assessment, it does not matter what language you use but the flashcards presented at
https://www.studystack.com/ would be an appropriate place to find suitable pairings. You
can use whatever language you like otherwise.
Your application should present players with a grid of fifty-two buttons, and each of those
will map on to a word or its translation. Each player will select a button, which will reveal its
contents, and a second button which will do the same. If there is a match, the buttons
should disappear, and the player should get a point. If not, the contents should be hidden,
and control should go to the next player.
The system then needs to allow the following:
• It needs to permit for players to choose a word set.
• It needs to create a grid of twenty-six words and their translations and map those to the
UI
• It needs to keep track of turn order and player actions within a turn
• It needs to eliminate used words from the UI
• It needs to track score and matches of buttons.
• A high score table of players and scores for each language should be retained
The program will also need to store user data such as name, success rates with particular
words, average score and average time to complete a game.
Your program then will need to perform the following operations:
• Set up the GUI
• Provide a way to add, modify and delete word sets.
• Provide players a way to choose word sets
• Set up an internal representation of words to their translation
• Map UI buttons to the words in the word set
• Implement a turn order for players
• Award points based on matching words and their translation
• Disable UI elements based on correctness of matches.
• Save the user data and statistics of each user along with the high score table.
Task 1
For a program which fully meets the requirements of the brief as
outlined above.
Class
dB connection
Player
Word
Forms
Add Player
Game
Dash
Insert
Update
View
Task 2- Testing
Black Box
Id | Form | Description | Test Values | Expected | Actual | Result |
1 | Insert Player | Inserting player name | Player1: test Player2: test | Game form should be opened and insert player form should be closed | Game form is opened and insert player form is closed | Pass |
2 | Insert Player | Testing Back button | Insertplayer form should be closed and dash should be opened | Insertplayer is closed and dash is opened | Pass | |
3 | Game | Testing loading of player name from insert player form | Player1:test Player2:test | Game should load with player1 and player 2 name | Game is loaded with player1 and player2 name | Pass |
4 | Game | Testing English button click at first | Button should display English language word | Button displays English language word | Pass | |
5 | Game | Testing Nepali button at first | Messagebox showing “Please select English word first” should be displayed | Messagebox showing “Please select English word first” is displayed | Pass | |
6 | Dash | Testing start button click | Dash should be closed and insertplayer form should be loaded | Dash is closed and insertplayer form should be loaded | Pass | |
7 | Update | Testing update button | Id:25 Word1: Test Word2:Test | Messagebox showing “Updated” should be displayed | Messagebox showing “Updated” is displayed | Pass |
8 | Update | Testing delete button | Id:25 | Messagebox showing “Deleted” should be displayed | Messagebox showing “Deleted” is displayed | Pass |