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

  Argue that problem is np complete

Argue that the following prob is NP Complete. Given a list of positive integers, u1,u2,...un (in binary representation) and asked if there is a partition of this set into 3 subsets, each of which has the same sum.

  Determine technology which has changed cafe,coffee shop

Determine technology which has changed cafe,coffee shop? Think things such as marketing, food preparation, inventory ordering or re-ordering, customer tracking, and more.

  Considering the flashlight-messaging

Considering flashlight-messaging (ABC=123);What are the key drawbacks of the Numbered Code(replacing each character with a number).

  Express what tool you used to change the password

Change the password of the CLASSMATE user to STUDENT using the console. Test your change by connecting to CLASSMATE in the SQL*Plus worksheet. Explain what tool you used to change the password. Save the explanation in a file.

  How to create a usetvshow.java file

design a class named TVShow.java. Data Fields can include a String containing the Name of the show, a String containing the day that the show is broadcast(i.e. â??Mondayâ?) and an integer for the channel where the show can be viewed.

  How can sophie use applocker

How can Sophie use AppLocker.

  What is one-dimensional array and its components are

at last, explain how two-dimensional arrays are different than one-dimensional arrays.

  Program utilizing small basic

Write down a program utilizing the Small Basic which prompts the user to input two integers: firstNum and secondNum (firstNum should be less than secondNum). Then utilizing the firstNum and secondNum:

  Write down an interactive web page named swap.html

Write an interactive Web page named swap.html that contains two text boxes and a button. When the user clicks the button, the contents of the two text boxes should be swapped.

  Avoiding breaches in health care information system

Analyze the financial and privacy impacts of the breaches to health care information systems and make at least two recommendations in order to prevent such breaches in future.

  How to calculate federal and fica taxes withheld

how to calculate federal and fica taxes withheld.

  Graphical user interface that calculates and displays

Write down a Java program without a graphical user interface that calculates and displays the mortgage payment amount given the amount of the mortgage, the term of the mortgage, and the interest rate of the mortgage.

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