Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

.txt file is provided for questions. write java code. your Work multiple times, but only the last submission will be graded. Description In this assignment,

image text in transcribed

image text in transcribed

image text in transcribed

.txt file is provided for questions. write java code.

your Work multiple times, but only the last submission will be graded. Description In this assignment, you are required to implement an electronic quiz system. User can write the quiz using the system, which can automatically check the score in the quiz. Your Task 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? 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". 1st Question 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? 2nd Question 6 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

Students also viewed these Databases questions