Step 2: 2 CS1411-003 Lab 07, 08 Create a Python program to read in the ‘Qsand0pt
ID: 3814699 • Letter: S
Question
Step 2: 2 CS1411-003 Lab 07, 08 Create a Python program to read in the ‘Qsand0pts.txt’ file into a list and to read in the ‘togive.txt’ file into a dictionary as given in the "Lab Preparation" Section. Allow the user to select a name and then give the associated quiz using the questions in the question set stored in the dictionary. Show the user his/her score at the end of the quiz. Allow the user to select as many names as desired and give the quiz for each name. In the sample run below, Judy is given questions 3, 8, 15, 17, and 22 in order from the questions file, but the questions are numbered from 1 to 5. Welcome to the quiz preparation program. Please input the name of a student who should take a practice quiz (enter EXIT to end the program): Judy Hi Judy. Here are your questions. 1. Question 1. First option 2. Second option 3. Third option What is your answer? 1 2. Question 1. First option 2. Second option 3. Third option What is your answer? 2 … You scored 3/5 – good job Please input the name of a student who should take a practice quiz (enter EXIT to end the program): EXIT Bye. For your program, do not use global variables except for DEBUG, validate all input, perform exception handling, and use at least 4 functions (each function should have its purpose immediately above the function).
THE FILES: (Once again, sorry I have no idea how to attach files) QsandOpts.txt
Why are manhole covers round in shape?
The cover cannot fall through if it is circular._Circular covers do not need to be precisely aligned._A round cover is easy to move and roll._Human beings have a roughly circular cross section._All of the above.
5
What is the result of dividing 3 by 4?
1.33333...._0.75._12._7._7._0.7777777777777
2
In the series 1,2,3,4,5,...100, how many of these numbers have the digit 7 in them?
9._10._19._20._11
3
What is the result of dividing 4 by 3?
1.33333...._0.75._12._7._7._0.7777777777777
1
Which operator makes the statement true? 1.1 x 8 (?) 10
>._<._=
2
Which operator makes the statement true? 6 (?) 2 x 2.3
>._<._=
1
Which operator makes the statement true? 3 x 1.5 (?) 4.5
>._<._=
3
Rick has 90 more bouncy balls than Abby. Abby has b bouncy balls. Choose the expression that shows how many bouncy balls Rick has.
90 - b._b._90._b + 90
4
Matthew earned b bonus points. Tara earned 59 more bonus points than Matthew. Choose the expression that shows how many bonus points Tara earned.
b + 59._b - 59._59 - b._59
1
Dave ate g out of 36 gumdrops. Choose the expression that shows how many gumdrops Dave has left.
g + 36._g - 36._36 - g._36 + g
3
What is the name of the insect which makes honey?
Honey fly._Bee._Mosquito
2
What word is the Spanish word for 'quick' and is used in English to mean 'at once'?
Pacy._Pronto._Rapido._Orale._Andale
2
Cantaloupe, Galia, and Honeydew are types of which fruit?
Berry._Orange._Melon._Avocado
3
What word for the outflow of a river is also the word for a bathroom sink?
Tub._Taza._Basin._Bucket
3
In America the Golden Gate Bridge is a feature of which city?
Chicago._New York._Dallas._San Francisco
4
Mother Theresa of Calcutta was awarded a Nobel prize for what?
Looking after poor children._Physics._Peace.-Literature._Medicine
3
Cantonese and Mandarin are languages which originated in which country?
Spain._England._Scotland._China._Brasil
4
In the game 'rock, paper,scissors', what beats paper?
Rock._Paper._Dynamite._Scissors._Water
4
In the anime NARUTO, Captain Yamato uses WOOD style ninjutsu because he can combine what 2 basic elements?
Water and Wind._Fire and Wind._Earth and Water._Earth and Fire._Earth and Wind
3
In the anime BLEACH, How many squads are in the Soul Society Protection Squads?
7._10._13._88._21
3
In any encarnation of the Justice League, what 2 characters are always present?
Wonder Woman & Cyborg._Shazam & Firestorm._Superman & Batman._Green Lantern & Flash
3
In Marvel's X-MEN, what is the codename of the one with adamantium claws?
Beast._Wolverine._Bishop._Arcangel._Sabretooth
2
How many amendments to the U.S constitution are in operation today?
10._13._27._7
3
What is the name of the Texas Tech fight song?
Victory Raiders!._Raider War Song._Hail Raiders!._Fight, Raiders, Fight
4
What is the name of the primary Texas Tech Red Raider mascot?
The Masked Rider._Red._The Red Horseman._Raider Red
1
What was the Texas Tech nickname from 1925-1936, before its athletes became known as Red Raiders?
Aggies._Cowboys._Matadors._Roughriders._Rangers
3
In the sitcom, 'The Big Bang Theory', from what Texas area is Sheldon Cooper?
West Texas._East Texas._South Texas._Texas Panhandle
2
How many states currently make up the United States of America?
48._49._50._51
3
----------------------------------------------------------------------------------------------------------------------------------------------------------
NAMES FILE::
Kevin
Austin
Alize
Andrew
Jake
Alex
Jose
Ryan
Dane
Cristhian
Dashiell
Riley
Chap
Zachary
Chris
Connor
Zovin
Nonso
Adrian
Joseph
Explanation / Answer
with open("file.txt", "r") as ins:
array = []
for line in ins:
array.append(line)
inp = file.txt
data = open(inp)
dat = data.read()
lst = dat.splitlines()
print lst
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.