This assignment requires you to write a program to simulate the Bonus Round of the television game show, "Wheel of Fortu

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

This assignment requires you to write a program to simulate the Bonus Round of the television game show, "Wheel of Fortu

Post by answerhappygod »

This Assignment Requires You To Write A Program To Simulate The Bonus Round Of The Television Game Show Wheel Of Fortu 1
This Assignment Requires You To Write A Program To Simulate The Bonus Round Of The Television Game Show Wheel Of Fortu 1 (65.13 KiB) Viewed 42 times
This Assignment Requires You To Write A Program To Simulate The Bonus Round Of The Television Game Show Wheel Of Fortu 2
This Assignment Requires You To Write A Program To Simulate The Bonus Round Of The Television Game Show Wheel Of Fortu 2 (56.9 KiB) Viewed 42 times
This Assignment Requires You To Write A Program To Simulate The Bonus Round Of The Television Game Show Wheel Of Fortu 3
This Assignment Requires You To Write A Program To Simulate The Bonus Round Of The Television Game Show Wheel Of Fortu 3 (74.49 KiB) Viewed 42 times
This assignment requires you to write a program to simulate the Bonus Round of the television game show, "Wheel of Fortune". The player must choose one of three categories. A puzzle is then selected from that category and presented to the player. If the puzzle contains 'R', 'S', 'T, L', 'N', or 'E', these letters are revealed. The player must then choose three consonants and a vowel. If the player entered the Bonus Round with a wildcard, an additional consonant must be chosen. The consonants and vowel chosen by the player are inserted in the puzzle if they are present and the player must then guess the puzzle. I In the television show, the player is given ten seconds to guess the puzzle. In this assignment, there is no time constraint, and the player is simply given three tries to guess the puzzle. If the player correctly guesses the puzzle, he/she wins a prize (typically, a car, $39,000.00, or the jackpot of $100,000.00). Struct Declaration Your program must use the following struct to store the data on each puzzle. You may use other structs if you wish. struct Puzzle ( }; string category; char puzzle [80]; Overview In the Kitchen Living Thing Movie Title Occupation 1. Reading Categories When your program starts, it must read the categories of puzzles from the text file, Categories.txt, and store them in an array of type string. A category can consist of one or more words. There are no more than 50 categories of puzzles. Here are four lines from the file: Description Around the House FLUFFY PILLOWS Around the House FULL-LENGTH WALL MIRROR 2. Reading Puzzles After reading the puzzle categories, your program must read the puzzles from the text file, WOF- Puzzles.txt, and store them in an array of Puzzle structs. The data for one puzzle must be read from two lines in the data file. The first line is the category of the puzzle, and the second line is the actual puzzle. Here are the first four lines from the file: The first puzzle is "FLUFFY PILLOWS". It is in the category, "Around the House". The second puzzle, "FULL-LENGTH VALL MIRROR" is in the same category. Puzzles are stored in uppercase letters.
3. Selecting and Displaying Three Categories Your program should randomly select three categories of puzzles from the array of categories and present them to the player. The player must then choose from one of the categories. This category will be used to randomly select a puzzle in the next stage. 4. Selecting and Displaying Puzzle After the player chooses a category, your program must randomly select a puzzle in that category from the array of Puzzle structs. Since a puzzle in any category can be randomly selected, it is important to repeatedly generate random numbers until a puzzle in the desired category is found. After selecting the puzzle, it is displayed to the player with the letters "blanked off. The character is used to hide the letters. If there are spaces or dashes (-) in the puzzle, these are revealed to the player, for example, the puzzle "FULL-LENGTH WALL MIRROR" would be displayed as follows: ****-****** 5. Revealing the Letters (R, S, T, L, N, E) After the puzzle is displayed, it is checked to determine if the letters "R, S, T, L, N, or 'E' are present in the puzzle. If so, every occurrence of these letters is revealed. So, the puzzle "FULL-LENGTH WALL MIRROR" would now be displayed as follows: #OLL-LENGT# ONLY BORROR 6. Letting the Player Choose 3 Consonants and 1 Vowel The player is now given a chance to choose 3 consonants and a vowel. After the player chooses these four letters, an input statement should be written to find out if the player has the wildcard. If so, the player can choose a fourth consonant. If the letters chosen by the player are present in the puzzle, they are revealed. Suppose that the player chose 'G', 'B', 'C' and '0' and that they did not have the wildcard. The puzzle would now be displayed as follows (since only 'G' and 'O' were present in the puzzle): #LL-LENGTE NELL ERROR 7. Giving the Player Three Attempts to Guess the Puzzle At this stage in the game, the player is given three attempts to guess the puzzle. If after three attempts the player did not guess the puzzle, an appropriate message is displayed, and the game comes to an end. If the player correctly guessed the puzzle, a prize must be randomly selected for the player. The prize possibilities are shown in the following table: Prize Car Probability 1/5 19/25 1/25 $39,000.00 Jackpot ($100,000.00) The game comes to an end after the prize is given to the player. 2
Programming Guidelines 1. Suppose inputFile is an ifstream. To read all the characters from one line and store them in a C- string (useful for reading categories and reading puzzles), use the following statements: char line[80]; inputFile.getline(line, 80); 2. To read all the characters on a line typed by the user at the keyboard (needed in the last stage of the game), use the following statements: char line[80]; cin.getline(line, 80); If you display output before the getline statement (e.g., when prompting the user to enter a guess), it is possible that the output might be duplicated. This can be ignored. If you wish to get rid of the duplicate output, the following statement can be used: cin.ignore(INT_MAX, "\n'); 3. In Stage 3, "Telecting and Displaying Three Categories", the three categories must be randomly selected from the array of categories. It should be noted that the second category chosen could be the same as the first one. Also, the third category chosen could be the same as the previous two. So, code must be written to ensure that the three categories selected are different. 4. You needn't cater for errors such as incorrect input by the player (including the choosing of letters already revealed). However, you should cater for letters and guesses being typed in any case. 5. You are free to write your own functions for this assignment. The following table contains a list of recommended functions. Your program should contain at least 5 functions which perform useful tasks such as those listed in the table. Function readCategories readPuzzles chooseCategory choosePuzzle blankOutPuzzle checkWildcard revealLetter rstine revealPrize Description Reads the categories from the file, Categories.txt, and stores them in an array of type string. Reads the puzzles from the file, WOF-Puzzles.txt, and stores them in an array of Puzzle structs. Randomly selects three categories, presents them to the player, and gets the player's choice. Randomly selects a puzzle from the category chosen by the player. Create a copy of the puzzle (for display purposes), blanking out all letters except spaces and dashes. Checks if the player has the wildcard. If a letter is present in the puzzle, reveals the letter in the puzzle displayed. Reveals the letters 'R', 'S', 'T', 'L', 'N', or 'E' if they are present in the puzzle. Reveals the prize to be awarded to the player if the puzzle was correctly guessed.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply