Write a program that plays a simple trivia game

Assignment Help Computer Engineering
Reference no: EM13323579

Write a program that plays a simple trivia game. The game should have five questions. Each question has a corresponding answer and point value between 1 and 3 based on the difficult of the question. Implement the game using three arrays. An array of type String should be used for the questions. Another array of type String should be used to store the answer. An array of type int should be used for the point values. All three arrays should be declared to be of size 5. The index into the three arrays can be used to tie the question, answer, and point value together. For example, the item at index 9 for each array would correspond to question 1, answer 1, and the point value for question 1. The item at index 1 for each array would correspond to question 2, answer 2, and the point value for question 2, and so forth. Manually hardcode the five questions, answer, and point values into your program using trivia of your choice. (Note: Since the Internet is the source of everything, you can turn to sites such as www. triviaplaying.com for some questions answers to use if you can' t think of any yourself.) Your program should ask the player each question one at a time and allow the player to enter an answer. If the player's answer matches the actual answer, the player wins the number of points for that question. It the player's answer is incorrect, the player wins no points for the question. Your program should show the correct answer if the player is incorrect. After the player has answered all five questions, the game is over, and your program should display the player's total score.

Reference no: EM13323579

Questions Cloud

What is the maximum number of instructions : What is the maximum number of instructions you can expect to be able to use in the program that processes the data? Keep in mind that your applications program must share memory with the operating system and with your data.
Define the mass balance equation and charge balance equation : Write the mass balance equation and charge balance equation for a solution that is 0.1 M FeCl3 and 0.2 M FeCl2
What is elongation of the pipe as it just begins to come out : The segments of pipe and couplings used for drilling an oil well 15,000 ft deep are made of A-36 steel weighing 20 lb/ft. They have an outside diameter of 5.50 in. and an inside diameter of 4.75 in.
Explain the appropriate m1 components : Use equations and words to explain how 2Px, 2Py, and 2Pz orbitals are constructed from 2P orbitals and the appropriate m1 components.
Write a program that plays a simple trivia game : Write a program that plays a simple trivia game. The game should have five questions. Each question has a corresponding answer and point value between 1 and 3 based on the difficult of the question.
What is min sight distance that should be provided on road : f the design speed of a multi-lane highway is 60 mph, what is the minimum sight distance that should be provided on the road if (a) the road is horizontal and (b) the road has a maximum grade of 5 percent
What is the direction of the balls displacement : A ball rolling on a table has a velocity with rectangular components vx = 0.50m/s and vy = 0.60m/s. What is the direction of the balls displacement
Evaluate the molar solubility of pb(io3)2 in water : Calculate the molar solubility of Pb(IO3)2 in water by systematic method. {ksp for Pb(IO3)2 = 2.5 x 10^-13}
Determine if the screen needs to be cleaned why or why not : After operating for a period of time, assume that the opening size decreases to 10-mm due to the accumulation of materials (debris) on the screens.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Implementing the python atm program

Write down a simple Python ATM program. Ask user to enter their account number, and then print their beginning balance. Then ask them if they wish to make a deposit or a withdrawal.

  Place the following terms into the logical sequence

Place the following terms into a logical sequence. Tell why you chose this sequence.(Note: Present your reordered terms in your suggested sequence. Do not use numbers or other methods to indicate the changed sequence.)

  Software driver that will implement a byte-wide data

Design the hardware and software driver that will implement a byte-wide data transfer from your processor to a peripheral device. Each transfer must be accompanied by a strobe to deskew the data. Draw the UML sequence diagram and the timing diagra..

  Selecting a life-cycle model for project

She wishes your organization to build a product which will monitor the company’s stock, starting with purchasing of leather and keeping track of boots as they are manufactured, distributed to individual stores, and sold to customers.

  Functional specifications for the software at workplace

what are two of the most important methods to examine and why.

  Define the ietf approach achieved ascendancy

express advantages/disadvantages of open vs. proprietary approaches to developing Internet protocol standards.

  Developing the marketing requirements

Develop a code scheme that will meet marketing managers stated requirements. Write down a brief memo to marketing manager proposing at least one alternative to the code she proposed

  Provide a java class named "input"

Provide a Java class named "Input" containing the method "readInt" (prototype given below) that displays the prompt string, reads an integer, and tests either it is between the supplied minimum and maximum. If not, it prints an error message and r..

  Give the trade-off between the two technologies

Cite two examples of a circuit switch and packet switch environment. Base one instance on a circuit switch and the other on a packet switch. Describe the trade-off between the two technologies and the reason why packet switching is more appropriat..

  Explain most computer memories are composed of a large

Most computer memories are composed of a large number different devices that are interconnected to form the whole memory array which is accessed using the address bus.

  Give the worst type of unwanted electronic communication

give the worst type of unwanted electronic communication.

  Define defense in depth

Define defense in depth

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