Design a simple card guessing game

Assignment Help Computer Engineering
Reference no: EM131787722

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

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: "<name>, you guessed right 4/10 rounds". Then, the game will exit with a goodbye message "Have a good day <name>!"

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.

Reference no: EM131787722

Questions Cloud

Small to be stored causes an underflow : For a floating-point value, generating an exponent that is too large to be stored causes an overflow; generating a negative exponent that is too small.
Compare the standard deviations : Make two separate stemplots.Are the distributions skewed? If so, which way?Compare the standard deviations.
Managers must be aware of this and foster communication : Managers must be aware of this and foster communication. What communication strategies stand out to you?
Prepare the appropriate journal entry to record gallo : Prepare the appropriate journal entry to record Gallo Light's 2011 income taxes. Show calculations and T-accounts
Design a simple card guessing game : CP5639 - Problem Solving and Programming - design a simple card guessing game, played by one player against the computer
Drastically reduce the number of unskilled immigrants : Some argue that the United States should drastically reduce the number of unskilled immigrants who are allowed into the country and embrace points based system
Accumulates in a sequence of calculations : Round off error. the error in the stored representation of a real value, may lead to annoying (or even serious) incorrect results when it accumulates
Prepare comparative condensed income statements : Prepare comparative condensed income statements for 2014 under FIFO and LIFO
Compute effective interest rate under each assumptions : A company plans to borrow $2 million for a year. The stated interest rate is 12 percent. Compute the effective interest rate under each of these assumptions.

Reviews

len1787722

12/29/2017 4:10:53 AM

Please name the files like: FirstnameLastnameA1.docx or FirstnameLastnameA1.pdf e.g. if your name were Miles Davis, the filename would be MilesDavisA1.docx. Due: Submit your assignment by the date and time specified on LearnJCU. Submissions received after this date will incur late penalties as described in the subject outline. Integrity: The work you submit for this assignment must be your own. You are allowed to discuss the assignment with other students and get assistance from your peers, but you may not do anyone else’s work for them and you may not get anyone else to do any part of your work.

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd