Cp5639 - problem solving and programming - design a simple


Task:
You are to plan a solution for the problem described below. Along with the tools that you have used in lectures and the workshops such as IPO charts, functions, condition/action and loop tables, create a solution to the problem. Your solution will be presented as a runnable flowchart and will be detailed in a planning document.

The Problem:
You are to design a simple card guessing game, played by one player against the computer.

The game will begin by asking the user for their name: "Hello, what is your name?", then welcome the player to the game saying " welcome to the Card Guessing Game!"

The game will display 2 options for the user: "Play game (P) or Quit (Q)?" If the user choses "q" or "Q", the game will exit with a goodbye message: "Goodbye !"

If the player choses "p" or "P", the game will begin with brief instructions: "You have 10 rounds to guess if the computer's card is higher or lower than yours. Good luck!"

If the player choses anything else, an error message will appear and the player will be asked to select again a correct option.

When playing, a game consists of 10 rounds; each round begins by showing the round number to the player "This is round 1 / 10". Then, the game will randomly generate two numbers, one for the player and one for the computer; the two cards are generated so that they are different in value. These numbers are whole numbers between 1 and 13, representing cards: Ace, 2 -10, Jack, Queen and King.

The player will then be told the value of their card with both the number and the name of the card (1 is an Ace, 11 is a Jack, 12 is a Queen, and 13 is a King). The player is asked to guess if the computer's card is higher or lower, by entering H or L: "Is the computer's card higher (H) or lower (L)?"

The player will have to make a guess by entering H or L; upper and lower case must be accepted, but any other input will result in an error and being asked again. Once the player has chosen, then the computer's card will be announced to the player. The player is told if he guessed right or not: "Well done, you guessed right!", or "Sorry, better luck next time." Keep in mind that the Ace (1) beats everything else.

At the end of the ten rounds, the player is informed how many rounds he guessed right: ", you guessed right 4/10 rounds". Then, the game will exit with a goodbye message "Have a good day !"

Planning:

You are to divide your solution into functions, following the principles shown in class. These may involve one for each menu option, as well as functions for parts of the program. For each function you are to provide an IPO chart listing all variables which are needed for your solution. In cases where selections are necessary, you must include a suitable condition action table directly below the IPO chart. You must also provide a loop description table for any loops needed in your plan.

Use the techniques and patterns that you have learned and seen demonstrated in class. Note that menu choice and other character selection should handle upper and lower case letters.

You also need to provide a flowchart with the complete game solution in Flowgorithm. Make sure that this flowchart and your planning document are consistent with each other!

You may show your assignment to your tutor during practical time to get comments or suggestions. It is important to note that you can only get help from staff in practical time after your practical work is finished.

Submission:
You will submit on LearnJCU:
1. The planning document: a MS Word document or PDF file, which contains:
- A list of all functions in your solution (including main) with a brief (1-2 sentence) description of what each function does.
- You will then have a section for EACH function, containing:
o An IPO chart for each function; the input is the list of variables (if any) passed
in to the function, and output is the variable (if any) returned from the function
o A condition/action table for each conditional structure (if any)
o The loop variable and exit condition for each loop used (if any)
- Other document formats (OpenOffice files, etc) are not acceptable.
2. A runnable Flowgorithm file containing the card guessing game as described above.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Cp5639 - problem solving and programming - design a simple
Reference No:- TGS02583233

Expected delivery within 24 Hours