Question

In: Physics

I NEED TO CREATE A GUI INTERFACE USING TKINTER CONTAINING : Colors, Image, Button, Title bar,...

I NEED TO CREATE A GUI INTERFACE USING TKINTER CONTAINING : Colors, Image, Button, Title bar, and a Menu bar FOR THE QUESTION BELOW: PLEASE HELP PROGRAMMING LANGUAGE IS PYTHON

Write a simple quiz game that has a list of ten questions and a list of answers to those questions. The game should give the player four randomly selected questions to answer. It should ask the questions one-by-one, and tell the player whether they got the question right or wrong. At the end it should print out how many out of four they got right.

Solutions

Expert Solution

'''Class Based Quiz'''class Question:
     def __init__(self, prompt, answer):
          self.prompt = prompt
          self.answer = answerquestion_prompts = [
     "Name the theory given by Albert Einstein?\n(a) 'Gravitational Law'\n(b)'Theory of Relativity'",'\n'
     "Physics is the study of?\n(a) 'Nature and Natural Phenomena'\n(b)'Chemicals Structures'",'\n'
    "Which branch of Physics deals with subatomic particles?\n (a) 'Classical Mechanics'\n (b) 'Quantum Mechanics'", '\n'
    "Photoelectric effect is given by?\n (a) 'Albert Einstein'\n (b) 'Isaac Newton'", '\n'
    "Which branch deals with Space Science?\n (a) 'Astrophysics'\n (b) 'Quantum Physics'", '\n'
]name = input("Please enter your name: ").title()questions = [
     Question(question_prompts[0], "b"),
     Question(question_prompts[1], "a"),
    Question(question_prompts[2], "b"),
    Question(question_prompts[3], "a"),
    Question(question_prompts[4], "a")
              ]def run_quiz(questions):
     score = 0
     for question in questions:
          answer = input(question.prompt)
          if answer == question.answer:
               score += 1
     print("\n{0}, you scored {1} out of {2}.".format(name, score, len(questions)))run_quiz(questions)

I have created a simple quiz of questions related to physics questions comprising of 5 questions.

You can modify the number and type of Questions and can also increase number of options as per your convenience.

You can use this syntax to create quiz.


Related Solutions

Python Using tkinter, create a GUI interface which accepts input of a GPA. If the GPA...
Python Using tkinter, create a GUI interface which accepts input of a GPA. If the GPA is >= 3.5, display 'Dean’s List' If the GPA is < 2.0, display 'Probation’ If the GPA is < 3.5 and >= 2.0, display 'Regular Standing' Run one test case for each case above and save the output.
Using tkinter, create a GUI interface which accepts input of annual income. Using the table below,...
Using tkinter, create a GUI interface which accepts input of annual income. Using the table below, determine and output the income tax for that income. Tax Rate Income 10% $0 to $9,875.00;  12% $9,876.01 to $40,125.00; 22% $40,126 to $85,525.00; 24% $85,526.01 to $163,300.00. Test with the following income data: 163,300.00 9,876.01 85,525.00
Python Create a tkinter GUI application that has two buttons on it. The first button should...
Python Create a tkinter GUI application that has two buttons on it. The first button should have in red text the word "Red" on it and the second button should have in blue text the word "Blue" on it. When the red button is clicked you should change the background color of the application window to red and when the blue button is pressed you should change the background color of the application window to blue. You should place your...
Using Tkinter for GUI, A Python program that will allow the user to perform (i) generate...
Using Tkinter for GUI, A Python program that will allow the user to perform (i) generate RSA keys, (ii) encrypt a given message and (iii) decrypt the message without using any cryptographic library. Your program will generate the values of p unless the user provides them manually. Then the program will generate the keys (private and public). Then the program will allow the user to enter his/her message to be encrypted. Finally, the program will perform the decryption operation as...
The objective of this project is to practice using Pythons GUI tkinter. You must use tkinter...
The objective of this project is to practice using Pythons GUI tkinter. You must use tkinter and no other GUI product. Design a small (ie 2x3) GUI window which contains 4 items: 1. A text keyin field, 2. An Execute button, 3. An Exit Button 4. A label. When the user clicks on the execute button, the text located in the keyin field will be displayed on the label. If the keyin field contains no text, a message box should...
In c# I need to create a simple payroll management system using visual basic and GUI....
In c# I need to create a simple payroll management system using visual basic and GUI. I also need to connect to SQL database. It needs a log in screen, inside the login screen it needs another screen to enter or edit employee information. It needs somewhere to enter hours worked for that specific employee, and another screen that can access reports.
I did the complete programming in python , just want to use tkinter for GUI. please...
I did the complete programming in python , just want to use tkinter for GUI. please look at the 2nd part . i did some part of this program using tkinter but could not finis it. Thank you. import random image = 'w' # modified functions which accepts two numbers each and returns the respective # output def add(a, b): return a + b def subtract(a, b): return a - b def multiply(a, b): return a * b def kidCalc():...
Use the below info to create a java program A GUI interface to ensure a user...
Use the below info to create a java program A GUI interface to ensure a user is old enough to play a game. Properly formatted prompts to input name, address, phone number, and age. Remember that name, address, phone number, etc. can be broken out in additional fields. Refer to the tutorial from this week’s Reading Assignment Multiple vs. Single Field Capture for Phone Number Form Input for help with this. Instructions to ensure that the information is displayed back...
i just need the Polygon class Shapes In this lab you will create an interface, and...
i just need the Polygon class Shapes In this lab you will create an interface, and then implement that interface in three derived classes. Your interface will be called Shape, and will define the following functions: Return Type Name Parameters Description double area none computes the area of the shape double perimeter none computes the perimeter of the shape Point2d center none computes the center of the shape You will then create 3 implementations of this interface: Rectangle, Circle, and...
In python using tkinter, I want to create a program. The program can have various classes...
In python using tkinter, I want to create a program. The program can have various classes and methods but I want it to have circles, triangles, and squares. Each shape movies in a certain way, like circles can move linearly, triangles can be affected by gravity, and squares can only go up and down. If the shapes get too close to one another then they disappear and a new shape appears somewhere else. I want this program to run continuously.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT