1 CS0008: Introduction to Computer Programming with Python Department of Computer Science, University of Pittsburgh Assignment 3: Who Wants to Be a Millionaire? DUE: December 13th, 2019 The goal of...

Create a game based on the PDF and the text file.


1 CS0008: Introduction to Computer Programming with Python Department of Computer Science, University of Pittsburgh Assignment 3: Who Wants to Be a Millionaire? DUE: December 13th, 2019 The goal of this assignment is to implement a simplified version of the game “Who Wants to Be a Millionaire?” (https://en.wikipedia.org/wiki/Who_Wants_to_Be_a_Millionaire_(U.S._game_show)), using the programming structures that seen in class. In each game (14) fourteen questions are asked to each participant and there are (4) four possible answers for each question. There is only (1) one correct answer. You’re not allowed to import any module other than random, but the rest of the implementation is up to you to decide the best approach as long as the end result meets what’s being asked, after all, you are now a Python developer! ? Game’s Payout Structure You need to implement: A python program that must have/do: (1) The “main” function that will display the main menu and coordinate the game’s execution. (2) The main game in which you will ask the user 14 random questions from the given “data.txt” file. i. In data.txt each question is defined between two dashed “-----“ lines. ii. After the first dashed line, you’ll find 2 empty spaces, the symbol ‘#’, the questions’ id in the database and the question’s prompt. iii. After the second “---“ line, (4) four possible answers are given (lines with options start with *). iv. Then you have an empty line and then the correct answer. v. And at the end it must calculate the user’s score. *(note that data.txt has more than 14 questions) IMPORTANT: Questions only start at line 51 Question Number Question Value 1 500.00$ 2 1,000.00$ 3 2,000.00$ 4 3,000.00$ 5 5,000.00$ 6 7,000.00$ 7 10,000.00$ 8 20,000.00$ 9 30,000.00$ 10 50,000.00$ 11 100,000.00$ 12 250,000.00$ 13 500,000.00$ 14 1,000,000.00$ https://en.wikipedia.org/wiki/Who_Wants_to_Be_a_Millionaire_(U.S._game_show) 2 ----------------------------------------------------------------------------- #0001 Which disease devastated livestock across the UK during 2001? ----------------------------------------------------------------------------- Hand-and-foot Foot-in-mouth Hand-to-mouth Foot-and-mouth Foot-and-mouth (3) The option for more than one player to play at a time, I. At the end print a list sorted from best score (winner) to lowest score. II. Each player should be asked only one question at a time, and then the next question is asked to second player and so on. (4) A hall of fame with names and scores of best 10 players (add option in the main menu) I. You must save scores to hof.txt file so you can recover it later. II. In hof.txt each line must start with the points (integer format) and then the player’s name Ex: 1000000 Sarah 1000000 John 500000 Peter 100000 Marge 100000 Rita 7000 Daniel III. The number of entries in hall of fame must not exceed 10. (5) A menu option that allows users to insert, modify (search question by number) and remove questions from the questions file: data.txt. Sample file content (data.txt): Hint: You may need to use the strip function during the reading of the file. (Remerber to remove question’s id) What you will need to submit You must submit the main game file titled “millionaire-.py” (e.g., your instructor would create “millionaire-mad371.py”). ****IMPORTANT: Before submitting it, remove the path to data.txt and hof.txt from your code.**** Ex: for Windows users: before: open(r“C:\Users\JDoe\Desktop\data.txt”, ‘r’) after: open(“data.txt”, ‘r’) for Mac users: before: open(r“/Users/JDoe/Desktop/data.txt”, ‘r’) after: open(“data.txt”, ‘r’) for Linux users: before: open(r“/home/JDoe/Desktop/data.txt”, ‘r’) after: open(“data.txt”, ‘r’) 3 Who Wants to be a Millionaire (1) New game (2) Hall of Fame (3) Manage Questions (4) Exit >>>1 Enter how many players will play: >>>1 Enter name for player 1: >>>Matt Player: Matt 1 #The siege of which town was the last major battle of the American Revolution? A. Yorktown B. Boston C. Lexington D. Hartford >>>A You are correct! Your prize so far: $500 Player: Matt 2 #According to the old adage, how many lives does a cat have? A. Five B. Seven C. Nine D. Ten >>>C You are correct! Your prize so far: $1,000 Player: Matt 3 #Which of these is a tool for shaping and smoothing wood? A. Train B. Plane C. Car D. Bike >>>B You are correct! Your prize so far: $2,000 Player: Matt 4 #Which of these non-elected people resigned from Downing Street in 2003? A. Jackie Stewart B. Patrick Stewart C. Patrick Campbell D. Alastair Campbell >>>D You are correct! Your prize so far: $3,000 Player: Matt 5 #The river Forth rises on the slopes of which Scottish peak? A. Ben Nevis B. Ben Lomond C. Ben Macdui D. Ben More >>>B You are correct! Your prize so far: $ 5,000 Player: Matt 6 #By what name was the city of St Petersburg known between 1924-1991? A. Stalingrad B. Petrograd C. Nizhniy Novgorod D. Leningrad >>>C INCORRECT! The correct answer was: D. Leningrad Player: Matt 7 #Complete the title of the long-running children's sitcom, 'Mike & ...'? A. Stefano B. Francesco C. Georgio D. Angelo >>>D You are correct! Your prize so far: $7,000 Player: Matt 8 #What shape is an Australian Rules football pitch? A. Rectangular B. Circular C. Diamond D. Oval >>>D You are correct! Your prize so far: $10,000 Player: Matt 9 #Which of these is a dish of fruit, preserved or cooked in a syrup? A. Composite B. Compote C. Compose D. Comport >>>B You are correct! Your prize so far: $20,000 Player: Matt 10 #Complete the title of this Sunday newspaper, 'News of the ...'? A. Day B. Country C. World D. Moment >>>A INCORRECT! The correct answer was: C.World Player: Matt 11 #Which of the following may be found on the neck of some stringed instruments? A. Fret B. Stress C. Vex D. Niggle >>>C INCORRECT! The correct answer was: A. Fret .... Continues asking other questions until 14 and then: Game Over, Matt. You won $100,000. Congratulations! Hit enter to continue >>> Shows MAIN MENU AGAIN Sample Output ///////////////////////////////////////////////////////////////////////////// Who Wants To Be A Millionaire? 2nd Edition Complete Question & Answer List [1012 Questions] Compiled by Labmaster v1.0 - 26/11/2005 ///////////////////////////////////////////////////////////////////////////// Introduction ///////////////////////////////////////////////////////////////////////////// There isn't much to say in way of introduction, or any of the usual remarks in an FAQ. Simply put, this is a complete list of questions and answers for the game. The questions have been arranged in order of difficulty, with the easiest ($100 level) questions coming first. ///////////////////////////////////////////////////////////////////////////// Copyright ///////////////////////////////////////////////////////////////////////////// This guide is Copyright © Labmaster, 2005. You are free to reproduce this guide on the condition that this copyright notice is retained. All trademarks contained within this guide are the property of their respective owners ///////////////////////////////////////////////////////////////////////////// Usage ///////////////////////////////////////////////////////////////////////////// What you do with this guide is up to you. To find a question, simply use your browser/text editor's search function
Dec 13, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here