Question: You are asked to write a Java program for the programming quiz system. There are two types of questions: Multiple Choice Question and Ture/False Question.







You are asked to write a Java program for the programming quiz system. There are two types of questions: Multiple Choice Question and Ture/False Question. User can create questions using the system; and preview the quiz, which display all questions in the system one by one. During the preview, the user can attempt the quiz by entering his/her answers to questions. The system will then immediately check the answer and calculate. After attempting all questions, the total score will be displayed. A sample run of the program is shown as below (Green text refers to user input): Please choose (c)reate a question, (p)review or (e)xit >> Enter the type of question (MC or TF) >> MC Enter the question text >> Each primitive type in Java has a corresponding class contained in the java.lang package. These classes are called classes. How many options? 4 Enter Option A (Start with * for correct answer) >> case Enter Option B (Start with * for correct answer) >> primitive Enter Option C (Start with * for correct answer) >> *type-wrapper Enter Option D (Start with * for correct answer) >> show How many points? 3 Please choose (c)reate a question, (p)review or (e)xit >> Enter the type of question (MC or TF) >> MC Enter the question text >> A(n) __ variable is known only within the boundaries of the method. How many options? 5 Enter Option A (Start with * for correct answer) >> method Enter Option B (Start with * for correct answer) >> *local Enter Option C (Start with * for correct answer) >> double Enter Option D (Start with * for correct answer) >> instance Enter Option E (Start with * for correct answer) >> global How many points? 2 Please choose (c)reate a question, (p)review or (e)xit >> Enter the type of question (MC or TF) >> TF Enter the question text >> Java is a free-form programming language. Answer is True or False? True How many points? 1 Please choose (c)reate a question, (p)review or (e)xit >> P Each primitive type in Java has a corresponding class contained in the java.lang package. These classes are called classes. (3.0 Points) A: case B: primitive C: type-wrapper D: show Enter your choice >> A You are wrong. The correct answer is C. A(n) variable is known only within the boundaries of the method. (2.0 Points) A: method B: local C: double D: instance E: global Enter your choice >> B You are correct! Java is a free-form programming language. (1.0 Points) True (T) or False (F) >> F You are wrong. The correct answer is true. The quiz ends. Your score is 2.0. Please choose (c)reate a question, (p)review or (e)xit >> Enter the type of question (MC or TF) >> MC Enter the question text >> A(n) constructor is one that requires no arguments. How many options? 3 Enter Option A (Start with * for correct answer) >> class Enter Option B (Start with * for correct answer) >> *default Enter Option C (Start with * for correct answer) >> explicit How many points? 2 Please choose (c)reate a question, (p)review or (e)xit >> Enter the type of question (MC or TF) >> TF Enter the question text >> Javascript and Java are the same. Answer is True or False? False How many points? 0.5 Please choose (c)reate a question, (p)review or (e)xit >> p Each primitive type in Java has a corresponding class contained in the java.lang package. These classes are called classes. (3.0 Points) A: case B: primitive C: type-wrapper D: show Enter your choice >> C You are correct! |A(n) variable is known only within the boundaries of the method. (2.0 Points) A: method B: local C: double D: instance E: global Enter your choice >> B You are correct! Java is a free-form programming language. (1.0 Points) True(T) or False(F) >> T You are correct! A(n) constructor is one that requires no arguments. (2.0 Points) A: class B: default C: explicit Enter your choice >> C You are wrong. The correct answer is B. Javascript and Java are the same. (0.5 Points) True(T) or False(F) >> F You are wrong. The correct answer is false. The quiz ends. Your score is 6.5. Please choose (c)reate a question, (p)review or (e)xit e Goodbye! Requirement: 1. The output of the program MUST EXACTLY the same as the above sample run of in character level. 2. You must create classes according to the following class diagram (Note: italic font refers to abstract methods/classes, while normal font refers to concrete methods/classes): Question Text : String point: double Question() Question(String qText) EgetqText(): String setqText(String qText): void FgetPoint(): double setPoint(double point): void grade(String answer) : double getCorrect Answer(): String MCQuestion TFQuestion -answer : boolean options: ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
