Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92596404

Have any Question?


Related Questions in Computer Engineering

Consider a project to supply 97 million postage stamps per

Consider a project to supply 97 million postage stamps per year to the U.S. Postal Service for the next five years. You have an idle parcel of land available that cost $1,690,000 five years ago; if the land were sold tod ...

You really need help with this assignment with step by step

You really need help with this assignment with step by step instructions on how to complete it. Using SQL Developer and SQL Plus 1. Create role customer_entry 2. Grant role customer_entry permission to update OE.CUSTOMER ...

What are the best practices to follow for microsoft windows

What are the best practices to follow for Microsoft Windows network security. Which two would you start with and why?

A mail order supplier advertises same-day service on every

A mail order supplier advertises same-day service on every order. Recently, the movement of orders has not gone as planned. The director of customer service has completely redone the method of order handling. The goal of ...

Wildhorse inc has outstanding bonds that will mature in six

Wildhorse, Inc., has outstanding bonds that will mature in six years and pay an 8 percent coupon semiannually. If you paid $1,009.52 today and your required rate of return was 7.0 percent.  (Round intermediate calculatio ...

Question suppose a network with 109 hostnames not including

Question : Suppose a network with 10^9 hostnames (not including the names of the nameservers themselves) uses non-recursive DNS. Assume that there is a single root nameserver, multiple local nameservers, and M levels of ...

The big bad wolf loves eating little pigs for breakfast

The big bad wolf loves eating little pigs for breakfast, lunch, dinner, supper, midnight snacks and he does know all about second breakfast. He tends to consume a lot of little pigs in a week. (He is probably not Jewish) ...

Question suppose that you have called a function called

Question : Suppose that you have called a function called sphere that creates (stores points and normals in a vertex Array and in the buffer) a sphere of radius 1 centered at the origin. Write the portions of the render ...

Given two eventsnbspgnbspandnbsph the probabilities of

Given two events  G  and  H , the probabilities of each occurring are as follows: P( G ) = 0.22; P( H ) = 0.34; P( H  AND  G ) = 0.09. Using this information: Find the complement of P ( H  AND  G ). Round to 2 places.

A small sports club keeps information about its members and

A small sports club keeps information about its members and the fees they pay. The secretary wants to be able to record when members pay and print a report similar to that in the figure below. last n me - first_narne - p ...

  • 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