Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Java, Write a program that grades a test. The test has 15 multiple choice questions. Here are the correct answers: 1. B 2. D

Using Java,

Write a program that grades a test. The test 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 test.

Write a program that holds the correct answers to the test 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 test 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

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

Creating A Database In Filemaker Pro Visual QuickProject Guide

Authors: Steven A. Schwartz

1st Edition

0321321219, 978-0321321213

More Books

Students also viewed these Databases questions