Problem: A simulation program is needed to determine if the ISU Quiz Bowl Team should comprise mainly of genius students or regular students. A primary requirement of this program that is different from your earlier assignments is that you are required to create 2 different Java classes in the design of your program. Here are some other design details that may be helpful: Design the classes should be placed in a package with the name edu.ilstu the all classes should have proper Avado comments Student class Keeps track of the brain power a student on the Quiz Bowl Team. This class should include the following: Instance Variables o student Nameofstudent Type o current Brain Power o current Score Methods of Getters for each instance variable O A method, void study(int time), which increases the student's current Brainpower. A genius student (i.e. student Type == 'g) increases their currentBrainPower at the rate of 2 times each time unit. A regular student (i.e. studentType == 'r') increases their currentBrainPower at the rate of 75 times each time unit. A method int answer Question (int answer) that will calculate the 074 ward BAI A method, void study (int time), which increases the student's currentBrainPower. A genius student (i.e. studentType == 'g) increases their currentBrainPower at the rate of 2 times each time unit. A regular student (i.e. studentType == 'r') increases their currentBrainPower at the rate of 75 times each time unit. O A method, int answer Question (int answer) that will calculate the student's answer to the Quiz Bowl Simulator question. A regular student answers the question by generating a random number between 1 and 100, costing the student a loss of brain power of 5 points. A genius student answers the question by generating random numbers until they get a random number that is within plus or minus 15 of the answer passed in. For each random number that a genius student generates while trying to get within plus or minus 15 points of the answer, they suffer a brain power loss of 3 points. O A method, void credit For Best Answer (), that will add 1 to the student's current Score. A constructor Student (char type, String name) which initializes the C Focus Page 1 of 4 874 words 100 until they get a random number that is within plus or minus 15 of the answer passed in. For each random number that a genius student generates while trying to get within plus or minus 15 points of the answer, they suffer a brain power loss of 3 points. O A method, void credit ForBestAnswer (), that will add 1 to the student's current Score. O A constructor Student (char type, String name) which initializes the student object using the two parameters for student Name and studentType. Genius student’s start with a current Brian Power of 50 and regular students start with a currentBrainPower of 30, Quiz Bowl class this is the starting point for the application which is the only class to contain a main method. You will use the Student class here. For this program, the main method handles all of the input and output for the program and will perform the following tasks: Create two instances of the Student class, with one student being a genius and one being a regular student. Have the genius student study for 2 hours. Have the regular student study for 6 hours. Loop until either one of the students runs out of brain power (i.e. currentBrainPower == 0) or one of the students reaches a score of 10 (i.e. current Score == 10) to Generate the answer (i.e. a random number between 1 and 100) o Ask the regular student for their answer to Ask the genius student for their answer п Page 2 of 4 874 words C Focus 10 T. 2:16 PM Sample Run ISU Quiz Bowl Simulator The Winner, a genius, Dr. Cliff scored 10 points and has brain power of 35 The Loser, a regular student, Jack Black, scored 3 points and has brain power of 15 Design Requirements: Your program should have two classes with only one having a main method. Pseudo code that will be followed to write the code. Program Submission Submit your .java file for your program with your initials and Program 4. O Example format: KES-Program4.zip Upload the following to Reggie Netof Your program file with your code torun the simulator 3 times. Does the same student win each of the three times?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here