Question: 1) Create a simple Java program for taking in answers to a multiple choice test, and then calculates the test score in a separate method.
1) Create a simple Java program for taking in answers to a multiple choice test, and then calculates the test score in a separate method. The program will have the following requirements: Please use a block comment to have your name, CIT 130, and a description of what the program does There will be two char arrays: . The first char array will be the answer key, prepopulated with a set of answers (eg. l'A,'B', C,'A','A'1)-This array should be declared in the getscore method defined below The second array will take in the end user's answers from the keyboard to fill it (There is no nextChar(), so you can use nextLine() and then use charAt(0) to convert the single letter answer to a char before adding it to the array- This array should be declared in the main method, and passed to the getScore method define belovw o o Once the student answers are put into the array from the keyboard, call a getscore method that takes the student answers array as input, and returns a double of their score .The getscore method will loop over the student answer array, checking if the value at the same index in the answer key matches the student answer at that index if it does increment the number of answers correct Calculate the score by dividing the number of answers correct by the array length .Return the score and display to the screer This assignment is intended to get you to demonstrate basic knowledge of creating and calli
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
