Define a trivia class that contains information
Course:- JAVA Programming
Reference No.:- EM131599444

Assignment Help >> JAVA Programming

Define a Trivia class that contains information about a single trivia question. The question and answer should be defined as instance variables of type String. Create accessor and mutator methods. In your main method create two Trivia objects with questions and answers of your choice. Then for each Trivia object have your program ask the question, input an answer, compare the typed answer to the actual answer, and output if the user's answer was correct.

Put your comment

Ask Question & Get Answers from Experts
Browse some more (JAVA Programming) Materials
Designand write a java application that reads a date in numeric form from a set of three fields and displays it in English within a label. Use appropriate buttons. For Examp
Write a program that reads a four-digit number from the keyboard as a string and then converts it into decimal. For example, if the input is 1100, the output should be 12. Hin
inputs one number consisting of five digits from the user, separates the number into its individual digits and prints the digits separated from one another by three spaces e
Write the source code for each class in a separate file which must have the same name as the class name together with the extension .java. Remember also that by convention,
Create a hang man type program - create the full final picture image, and then rub out a piece and save it as a different filename, then rub out another part and save it as a
Create a console program that prompts the user to enter the name and address of their employer and position they hold or the name and address of their favorite restaurant an
Write a CarbonFootPrint with only a pure virtual getCarbonFootprint method -  Have each of your classes inherit from the abstract class and implement the getCarbonFootprint m
Create an easy to read report layout (consistent spaces for each column and column headers) for the daily report (HINT: column headers you can use...auto info, price/discoun