Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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 !"

Example of How the Game Runs:
C: Hello, what is your name?
P: Fred
C: Fred welcome to the Card Guessing Game!
C: Play game (P) or Quit (Q)?
P: x
C: Incorrect option, please choose P for Playing the game or Q for Quitting. P: xyz
C: Incorrect option, please choose P for Playing the game or Q for Quitting. P: Q
C: Goodbye Fred.
C: Hello, what is your name?
P: Fred
C: Fred welcome to the Card Guessing Game!
C: Play game (P) or Quit (Q)?
P: p
C: You have 10 rounds to guess if the computer's card is higher or lower than yours. Good luck!
C: This is round 1 / 10. Your card is 2 Two.
C: Is the computer's card higher (H) or lower (L)? P: abc
C: Incorrect option, please choose H for Higher or L for Lower.
P: H
C: The computer's card is 11 Jack Well done, you guessed right!
C: This is round 2 / 10. Your card is 7 Seven.
C: Is the computer's card higher (H) or lower (L)? P: L
C: The computer's card is 9 Nine. Sorry, better luck next time.
C: This is round 3 / 10. Your card is 10 Ten.
C: Is the computer's card higher (H) or lower (L)? P: L
C: The computer's card is 1 Ace. Sorry, better luck next time.
C: This is round 10 / 10. Your card is 12 Queen.
C: Is the computer's card higher (H) or lower (L)? P: L
C: The computer's card is 4 Four. Well done, you guessed right!
C: You guessed right 6/10 rounds. Have a good day Fred!

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92583023
  • Price:- $160

Guranteed 48 Hours Delivery, In Price:- $160

Have any Question?


Related Questions in Computer Engineering

Understanding the digital revolution assignment - parchment

Understanding the Digital Revolution Assignment - Parchment Purgatory Overview - For this assignment, you will use skills acquired through practical laboratory exercises to automate a business process, and to visualize t ...

Question introduction to management information systemsread

Question: Introduction to Management Information Systems Read at least three (3) academically reviewed articles on Management Information Systems and complete the following activities: (Wikipedia articles will not be acc ...

Software design processquestion what are the best practices

Software Design Process Question: What are the best practices in writing program? Describe each one briefly. Noe: This question needs to be research. The book may all of the beat practice listing.

Create login form to enter user name and a password textbox

Create login form to enter user name and a password textbox to enter password, and write procedure to simulate the process of triggering the login process after hitting the Enter Key.

The correlation between the height of fathers in the

The correlation between the height of fathers in the heights of their sons is r=0.52. Which kind of the following would not change r? a) measuring their height in centimeters rather than inches. b) removing two outliers ...

If we compare and contrast the four market structures it is

If we compare and contrast the four market structures, it is evident that one market structure is most practiced and evident in the United States. It is the one that promotes and strives on competition. It is the one tha ...

Access your browsers security settings and configure the

Access your browser's security settings and configure the browser to refuse all cookies or to prompt you before allowing a cookie. Restart the browser; then visit several different Web sites. Be sure to visit popular sit ...

Reading the biographybook where the body meets memory by

Reading the Biography Book : "Where the Body Meets Memory" by David Mura Questions: 1. The internment camps were a very painful experience for Japanese Americans. They were also a very important and awkward chapter in Am ...

Systems analysis projectpersonal trainer inc owns and

Systems analysis project Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a new "superce ...

Salesthe sales department is in a unique position customers

Sales The sales department is in a unique position: customers seek out Thermo-Chem because it has cornered the market with virtually no competition except in the chemicals market. Therefore, only limited sales effort is ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As