Written in Python
In this lab, you are to build a trivia game. The game should present each question – either in order or randomly – to the player, and display up to four possible answers. The player is to input what they believe to be the correct answer. The game will tell the player if they got it right or wrong and will display their score. If they got it right, their score will go up. If they got it wrong, their score will stay the same. After all the questions have been asked, the game will present the final score correct, the final score incorrect and allow the player to play again if they choose.
You have a lot of leeway in designing this game and you can use your book though there are minimum requirements to obtain all 30 points (mentioned after this paragraph). Develop your own code and try to use as many of these tools and techniques that you learned about in Chapters in your text. You may leverage other techniques in other Chapters that were not covered if you like, BUT you will need to add comments to the code with why you selected them and a brief description on how it works.
Your final script MUST include the following at a minimum:
You will be graded on your program design and how well you incorporated what you have learned. If you get stuck or need some guidance, please feel free to ask.
To get you started, here are five, four-answer multiple choice questions that you can use. The correct answers have been denoted with an asterisk. You may use your own questions if you like. When you “load” the questions into your program, you may re-write them however you need to.
How many computer-generated effects were used in the movie Lord of the Rings - Return of the King?
540
799
1205
*1488
In the movie "The Blues Brothers", what does Jake order at the diner?
A medium pizza with pineapple and ham
3 cheeseburgers with the works and a tall glass of milk
* 4 fried chickens and a Coke
A small Greek salad with extra feta, a steak (well done), 2 baked potatoes, and a coffee
In The Simpsons, what football team has Homer always wanted to own?
Washington Redskins
*Dallas Cowboys
Denver Broncos
Cleveland Browns
In the TV show Seinfeld, what did Elaine decide was 'her song'?
I am Woman
Desperado
Yesterday
* Witchy Woman
Babe Ruth debuted in professional baseball at the age of 19 years old with which team?
* Boston Red Sox
New York Yankees
St Louis Browns
Cincinnati Reds
# function for giving choice to the user to play or exit from
the game
def world(x):
print(" Press '1' for Playing game ")
print(" Press '2' to Exit from TRIVIA's WORLD ")
n=1
print(world(2))
#loop for running the game as many times the user want to
play
while n>0:
# take user response ,1 for playing and 2 to exit from the
game
opt=int(input(" Enter your choice :"))
# if user give 1 as input, the game starts:
if opt==1:
print("***** WELLCOME TO TRIVIA GAME *****")
name=input("enter your name:")
print("Hello ",name)
print("You Will be asked with 7 question containg 4 options.\
you have to only tell the correct option.\
correct answer will rise your score by 1 & worng answer will
let your score remain same")
print(" so lets start the game ....")
print(" press '7' to start the game ")
#Ask user to input 7 to start the game
start=int(input("Enter your choice:"))
if start==7:
point=0
# time module is used to add delay in the execution of
program
import time
print(" So the frist question is on your screen ")
# time.sleep ise used for giving time delay of 1 second:
time.sleep(1)
q1=''' (Q-1) Grand Central Terminal, Park Avenue, New York is the
world's:
(a) largest railway station
(b) highest railway station
(c) longest railway station
(d) None of the above '''
print(q1)
ans=input(" Enter your choice :")
if ans=="largest railway station":
print(" Your answer is correct")
point+=1
print(" Your total score is:",point)
else:
print(" Your answer is wrong")
print(" your total score is :",point)
print(" So the Second question is on your screen ")
time.sleep(1)
q2=''' (Q-2) Entomology is the science that studies :
(a) Behavior of human beings
(b) Insects
(c) The origin and history of technical and scientific terms
(d) The formation of rocks '''
print(q2)
ans=input(" Enter your option :")
if ans=="Insects":
print(" Your answer is correct")
point+=1
print(" Your total score is:",point)
else:
print(" Your answer is wrong")
print(" your total score is :",point)
print(" So the Third question is on your screen ")
time.sleep(1)
q3=''' (Q-3) FFC stands for :
(a) Foreign Finance Corporation
(b) Film Finance Corporation
(c) Federation of Football Council
(d) None of the above '''
print(q3)
ans=input(" Enter your option :")
if ans=="Film Finance Corporation":
print(" Your answer is correct")
point+=1
print(" Your total score is:",point)
else:
print(" Your answer is wrong")
print(" your total score is :",point)
print(" So the Fourth question is on your screen ")
time.sleep(1)
q4=''' (Q-4) Galileo was an Italian astronomer who :
(a) developed the telescope
(b) discovered four satellites of Jupiter
(c) discovered that the movement of pendulum produces a regular
time measurement
(d) All of the above '''
print(q4)
ans=input(" Enter your option :")
if ans=="All of the above":
print(" Your answer is correct")
point+=1
print(" Your total score is:",point)
else:
print(" Your answer is wrong")
print(" your total score is :",point)
print(" So the Fiveth question is on your screen ")
time.sleep(1)
q5=''' (Q-5) First human heart transplant operation conducted by
Dr. Christian Bernard on Louis Washkansky, was conducted in :
(a) 1967
(b) 1968
(c) 1958
(d) 1922 '''
print(q5)
ans=input(" Enter your option :")
if ans=="1967":
print(" Your answer is correct")
point+=1
print(" Your total score is:",point)
else:
print(" Your answer is wrong")
print(" your total score is :",point)
print(" So the Sixth question is on your screen ")
time.sleep(1)
q6=''' (Q-6) Epsom (England) is the place associated with :
(a) Horse racing
(b) Polo
(c) Shooting
(d) Snooker '''
print(q6)
ans=input(" Enter your option :")
if ans=="Horse racing":
print(" Your answer is correct")
point+=1
print(" Your total score is:",point)
else:
print(" Your answer is wrong")
print(" your total Money is :",point)
print(" So the Seventh question is on your screen ")
time.sleep(1)
q7=''' (Q-7) Fastest shorthand writer was :
(a) Dr. G. D. Bist
(b) J.R.D. Tata
(c) J.M. Tagore
(d) Khudada Khan '''
print(q7)
ans=input(" Enter your option :")
if ans=="a":
print(" Your answer is correct")
point+=1
print(" Your total score is:",point)
else:
print(" Your answer is wrong")
print(" your total score is :",point)
print(name," You Final score is : ",point," out of 7" )
print(world(2))
#if user input 2 then the game Exit
if opt==2:
print(" Thanks for visiting in TRIVIA'S WORLD ")
n=n-1
break
Written in Python In this lab, you are to build a trivia game. The game should...
java In this project you will implement a trivia game. It will ask random trivia questions, evaluate their answers and keep score. The project will also have an administrative module that will allow for managing the question bank. Question bank management will include adding new questions, deleting questions and displaying all of the questions, answers and point values. 2. The project can be a GUI or a menu based command line program. 3. Project details 1. Create a class to...
For your final project you will incorporate all your knowledge of Java that you learned in this class by programming the game of PIG. The game of Pig is a very simple jeopardy dice game in which two players race to reach 100 points. Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player holds and scores the sum of the rolls (i.e. the turn total). At any time during a player's turn,...
need help, dont understand how to set up. 1 You are a game developer at Microsoft Corporation and are charged with the task of developing games in C++. 2 Please develop a Rock Paper Scissor game for two players. Each player should have one of the following options: • 1. Rock • 2. Paper • 3. Scissor A. Player One: person You need to ask the person to enter one option from the above three. 10 B. Player Two: computer...
In this programming exercise, you will create a simple trivia game for two players. The program will work like this: Starting out with player 1, each player gets a turn at answering 5 trivia questions. (There should be a total of 10 questions.) When a question is displayed, 4 possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point. After answers have been selected...
java In this project you will implement a trivia game. It will ask random trivia questions, evaluate their answers and keep score. The project will also have an administrative module that will allow for managing the question bank. Question bank management will include adding new questions, deleting questions and displaying all of the questions, answers and point values. 2. The project can be a GUI or a menu based command line program. 3. Project details 1. Create a class to...
Here’s your task: You’re going to create exactly two classes. One class will act as the functional server. The main method of this server will setup the connection on a localhost, find the two clients, let them know which one is Player 1 and which one is Player 2 (depending on the order they connect), and then manage the game as it’s being played. This is important: For each player’s turn they should start by displaying their current score to...
IN PYTHON Up until now, we have learned about printing text to the screen, functions, parameters, loops, how to get input from users, text processing, and how to use if/else statements to have different execution paths. Everything we need in order to make our first game! For this assignment write a text-adventure game. Your game must have the following: at least 4 choices the player must make a different outcome for each of the 4 choices For extra points, draw...
In Java Problem Description/Purpose: Write a program that will compute and display the final score of two teams in a baseball game. The number of innings in a baseball game is 9. Your program should read the name of the teams. While the user does not enter the word done for the first team name, your program should read the second team name and then read the number of runs for each Inning for each team, calculate the...
Hello I need help with python programming here is my code # Trivia Challenge # Trivia game that reads a plain text file import sys def open_file(file_name, mode): """Open a file.""" try: the_file = open(file_name, mode) except IOError as e: print("Unable to open the file", file_name, "Ending program.\n", e) input("\n\nPress the enter key to exit.") sys.exit() else: return the_file def next_line(the_file): """Return next line from the trivia file, formatted.""" line = the_file.readline() line = line.replace("/", "\n") return line def next_block(the_file):...
I’m trying something new with these types of problems, so please provide feedback if you have any. If you work through the “Build a Trivia Game” problems throughout the course’s tutorials, by the end of the course you will have created a trivia game that retrieves questions from the Internet, keeps track of a user’s score throughout a game, and remembers the high scores forever. This week, we will start with a simplified version of a trivia game (decomposition!) and...