Write a question class to hold the data for trivia question

Assignment Help Python Programming
Reference no: EM131651624

Programming Assignment

In this programming exercise you will create a simple trivia game for two players. The program will work like this:

• Starting 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 for all the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner.

To create this program, write a Question class to hold the data for a trivia question. The Question class should have attributes for the following data:

• A trivia question
• Possible answer 1
• Possible answer 2
• Possible answer 3
• Possible answer 4
• The number of the correct answer (1, 2, 3, or 4)

The Question class also should have an appropriate __init__ method, accessors, mutators and an __str__ to display the question and possible choices.

The program should have a list or a dictionary containing 10 Question objects, one for each trivia question. Make up your own trivia questions on the subject or subjects of your choice for the objects.

Program Description: You write a short description of what the program will do

When you complete the program, do the following.

1. Create a folder with the following name: ProgramAssignment02
2. Copy your program to this folder
3. Copy the folder to your folder in the I:\kopp\inbox\CS 222 01 folder
4. Print a copy of the source code and turn it in.

Reference no: EM131651624

Questions Cloud

Calculate the possible values of x : An economics quiz contains six multiple-choice questions. Let x represent the number of questions a student answers correctly.
Discuss argument against psychological egoism : What is Rachel's strongest argument against psychological egoism. Against ethical egoism. Are Rachel's arguments persuasive
Provide an example of weaponized industrial cyber threats : Provide an example of weaponized industrial cyber threats. Why the industrial network protocols become common industrial targets?
Show the probability distribution graphically : Two numbers are randomly drawn without replacement from a list of five. If the five numbers are 2, 2, 4, 6, 8, what is the probability distribution.
Write a question class to hold the data for trivia question : To create this program, write a Question class to hold the data for a trivia question. You write a short description of what the program will do.
Calculate and comment on the working capital ratio : The subject you are studying is vocational. It is designed with the workplace in mind. Work integrated assessment provides opportunities for students.
How would they be required to account for any capital gain : HI6028 Taxation Theory, Practice & Law - how would they be required to account for any capital gain or capital loss and What principle was established
Build software testing process through developing structure : Build the software testing process through developing the structure for the unit/usability/system test plan, method/procedure, and report.
What are the methods of performance evaluation : What are the methods of initial selection? What are the methods of performance evaluation?

Reviews

Write a Review

Python Programming Questions & Answers

  Compare programming with python and programming with scratch

Compare programming with python and programming with scratch. Describe the same program you might create in both programming languages.

  Create a python script that will implement the given command

Write a python script that will implement the following command: merge sourcedirectory1 sourcedirectory2 destinationdirectory. The merger is a union operation, so that if a file/directory exists in either source directory it is included in the new d..

  Define the playround method with only the self parameter

Define the playRound method with only the self parameter. Make a call to another instance method called doRolls that takes no arguements.

  How to step through and process the elements of a list

Programming in Python CS21A- Learn how to find high and low values of a list. Learn how to step through and process the elements of a list. Learn how to pass lists as arguments to a function. Learn how to wr..

  Program to do the enciphering

Write a program to do the enciphering. It should prompt the user for a message, and print out both the entered message and its corresponding ciphertext.

  How is the survival chance related to the gender

How is the survival chance related to the gender? How is the survival chance related to age? How is the survival chance related to socio-economic status?

  Implement algorithms for sorting in python

MCD4710 Algorithmic Problem Solving - write a Python program similar to the one from Part A but sort by the total medal count instead. So instead of sorting by the number of gold medals that each team won, this time it should be sorted by the total..

  Write a function rmduplic(l), where l is any list

Write a function rmDuplic(L), where L is any list. The function should return a list M that contains the same items as L, except that repetitions (duplicates) have been removed: only the first occurrence of each entry is kept (i.e., order is prese..

  Write a python program that asks the user to guess a number

Write a Python program that asks the user to guess a number between 0 and 100 and give feedback that tells the user the guess was too high or too low until.

  Data file is a comma separated

The data file is a comma separated text values stored in a file with '.CSV' extension. The file has five columns corresponding to employee data fields listed above.

  Create functions to simplify your code

Create functions to simplify your code. If you find yourself writing the same code over and over again, it should probably be made into a function.

  Write a program using the ''requetinteger''

using python/jython programming write a program using the 'requetInteger' function that will ask the user to type a value that will draw a line from one point on a picture to another. I don't need specific help just a gerneral idea.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd