Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN JAVA You must use arrays, static methods, loops and decision making constructs Your instructor has asked you to write a program that grades an
IN JAVA
You must use arrays, static methods, loops and decision making constructs
Your instructor has asked you to write a program that grades an esam. The esam has 15 multiple choice questions. Here are the correct answers: 1. B 2. D 3. A 4. A 5. C 6. D 7. A 8. B 9. C 10. A 11. B 12. C 13. D 14. A 15. B A student must correctly answer 12 out of the 15 questions to pass the esam. Write a program that holds the correct answers to the esam in an array. The program should have an array that hold's the student's answers. The program should have the following static methods:
a. passed() returns true if the student passed the esam or false if the student failed. b. totalCorrect() - Return the total number of correctly answered questions. c. totalIncorrect() - Returns the total number of incorrectly answered questions. d. An int array containing the questions numbers of the questions that the student missed. Demonstrate the program by setting the values of student's answers in main(You are not required to prompt the user to enter values using Scanner or System.in.read()), and then display the result returned from the methods written in the program. Here are some suggestions on variable and method declarations. char [] coorectAns = new char[15]; char [] studentAns = new char[15]; static boolean passed(char [] correct, char [] student) { } static int totalCorrectAnswers(char [] correct, char [] student) { } static int totalInCorrectAnswers(char [] correct, char [] student) { } static int [] questionNumbersMissed(char [] correct, char [] student) { //which questions were either not answered or were incorrect. //declaring a char array that keeps track of the questions that were incorrectly answered. }
Step 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