Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is the txt file AstrologyQuiz.txt. 5 Which zodiac sign looks like a pair of fish? *Pisces Aquarius Libra Virgo Which of the following zodiac
This is the txt file AstrologyQuiz.txt.
5 Which zodiac sign looks like a pair of fish? *Pisces Aquarius Libra Virgo Which of the following zodiac signs is called "the bull"? Aries Gemini *Leo Scorpio How many signs are in the zodiac? 6 *12 14 24 What is the last sign in the astrological calendar? Aries Sagittarius *Pisces Cancer Which of these is not an air sign? Gemini Libra Aries *Virgo
You are asked to write a Java program for the electronic quiz system. The question will be displayed one by one. The user will enter his/her answer, which is either A, B, C, or D. The system will then immediately check the answer and produce the result. 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): Welcome to Astrology Test Question 1: Which zodiac sign looks like a pair of fish? A: Pisces B: Aquarius C: Libra D: Virgo Enter your answer (A, B, C, or D): A Correct. Question 2: Which of the following zodiac signs is called "the bull"? A: Aries B: Gemini C: Leo D: Scorpio Enter your answer (A, B, C, or D): B Incorrect. The correct answer is C Question 3: How many signs are in the zodiac? A: 6 B: 12 C: 14 D: 24 Requirement: 1. The output of the program MUST EXACTLY the same as the above sample run of in character level. 2. You must create a class Question, which stores information of a question: the question text, the options, and the correct answer; 3. You must create a class Asgn02, which has the main method to run the program. 4. You must store all questions in an array and make use of this array throughout the program. 5. You are NOT allowed to use other build-in data structures/classes like ArrayList, Set, HashMap, etc. Input File Format: All questions are stored in the file "AstrologyQuiz, txt". The first line of the file indicates the number of questions in the file. Next, for every five consecutive lines, the first line refers to the question text, while the second to fifth lines refer to the four options. The true answer starts with a "*", which should NOT be displayed in the system. The following shows a sample content of the file Astrology Quiz.txt. 5 Which zodiac sign looks like a pair of fish? *Pisces Aquarius Libra Virgo Which of the following zodiac signs is called "the bull"? Aries Gemini *Leo Scorpio How many signs are in the zodiac? 1st Question 2nd Question You are asked to write a Java program for the electronic quiz system. The question will be displayed one by one. The user will enter his/her answer, which is either A, B, C, or D. The system will then immediately check the answer and produce the result. 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): Welcome to Astrology Test Question 1: Which zodiac sign looks like a pair of fish? A: Pisces B: Aquarius C: Libra D: Virgo Enter your answer (A, B, C, or D): A Correct. Question 2: Which of the following zodiac signs is called "the bull"? A: Aries B: Gemini C: Leo D: Scorpio Enter your answer (A, B, C, or D): B Incorrect. The correct answer is C Question 3: How many signs are in the zodiac? A: 6 B: 12 C: 14 D: 24 Requirement: 1. The output of the program MUST EXACTLY the same as the above sample run of in character level. 2. You must create a class Question, which stores information of a question: the question text, the options, and the correct answer; 3. You must create a class Asgn02, which has the main method to run the program. 4. You must store all questions in an array and make use of this array throughout the program. 5. You are NOT allowed to use other build-in data structures/classes like ArrayList, Set, HashMap, etc. Input File Format: All questions are stored in the file "AstrologyQuiz, txt". The first line of the file indicates the number of questions in the file. Next, for every five consecutive lines, the first line refers to the question text, while the second to fifth lines refer to the four options. The true answer starts with a "*", which should NOT be displayed in the system. The following shows a sample content of the file Astrology Quiz.txt. 5 Which zodiac sign looks like a pair of fish? *Pisces Aquarius Libra Virgo Which of the following zodiac signs is called "the bull"? Aries Gemini *Leo Scorpio How many signs are in the zodiac? 1st Question 2ndStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started