nd he ng ght OW 12 13 14 15 16 LISTING Grade Exam.java 1 public class...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
nd he ng ght OW 12 13 14 15 16 LISTING Grade Exam.java 1 public class GradeExam { 2 /** Main method */ 17 PEZZELNE 285 Key DBD CCDAEAD Your program grades the test and displays the result. It compares each student's answers with the key, counts the number of correct answers, and displays it. Listing 8.2 gives the program. gribnitybus2 sas) 0.8 3 public static void main(String[] args) { // Students' answers to the questions char[] [] answers = { 4 5 6 7 8 9 10 11 18 19 20 22 23 24 25 Student O Student 1 Student 2 Student 3 Student 4 Student 5 Student 6 Student 7 The key is stored in a one-dimensional array: husqaroo 27 29 Students' Answers to the Questions: 0 1 2 3 4 5 6 7 8 9 //. 8.5 Case Study: Grading a Multiple-Choice Test 297 ABACCDEEAD DBABCAEEAD EDDACBEEAD CBAEDCEEAD ABD CCDEEAD BBECCDEEAD BBACCDEEAD EBECCDEEAD Key to the Questions: 0123456789 } {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'}, {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'}, {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'}, {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; // Grade all answers for (int i = 0; i < answers.length; i++) { // Grade one student int correct Count = 0; for (int j = 0; j < answers [i].length; j++) { if keys [j]) (answers[i][j] correct Count++; correctCount); // Key to the questions char[] keys = {'D', 'B', 'D', 'C', 'C, 'D', 'A', 'E', 'A', 'D'}; to englis System.out.println("Student " + i + "'s correct count is " + S 2-D array 1-D array 24-1201 compare with key er 8 Multidimensional Arrays $260 28 Student O's correct count is 7 Student 1's correct count is 6 Student 2's correct count is 5 Student 3's correct count is 4 Student 4's correct count is 8 Student 5's correct count is 7 Student 6's correct count is 7 Student 7's correct count is 7 Check Point of The statement in lines 5-13 declares, creates, and initializes a two-dimensional array characters and assigns the reference to answers of the char [] [] type. The statement in line 16 declares, creates, and initializes an array of char values and assigns the reference to keys of the char[] type. Each row in the array answers stores a student's answer, which is graded by comparing it with the key in the array keys. The result is displayed immediately after a student's answer is graded. 8.5.1 How do you modify the code so it also displays the highest count and the student with the highest count? 8.6 Case Study: Finding the Closest Pair This section presents a geometric problem for finding the closest pair of points. Key Point choice test 8.5 Case Study: Grading a Multiple-Choice Test The problem is to write a program that will grade multiple-choice tests. pne Suppose you need to write a program that grades multiple-choice tests. Assume there are eight students and ten questions, and the answers are stored in a two-dimensional array. Each row records a student's answers to the questions, as shown in the following array: 2222 23 24 25 26 27 2235 28 29 30 31 nd he ng ght OW 12 13 14 15 16 LISTING Grade Exam.java 1 public class GradeExam { 2 /** Main method */ 17 PEZZELNE 285 Key DBD CCDAEAD Your program grades the test and displays the result. It compares each student's answers with the key, counts the number of correct answers, and displays it. Listing 8.2 gives the program. gribnitybus2 sas) 0.8 3 public static void main(String[] args) { // Students' answers to the questions char[] [] answers = { 4 5 6 7 8 9 10 11 18 19 20 22 23 24 25 Student O Student 1 Student 2 Student 3 Student 4 Student 5 Student 6 Student 7 The key is stored in a one-dimensional array: husqaroo 27 29 Students' Answers to the Questions: 0 1 2 3 4 5 6 7 8 9 //. 8.5 Case Study: Grading a Multiple-Choice Test 297 ABACCDEEAD DBABCAEEAD EDDACBEEAD CBAEDCEEAD ABD CCDEEAD BBECCDEEAD BBACCDEEAD EBECCDEEAD Key to the Questions: 0123456789 } {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'}, {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'}, {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'}, {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; // Grade all answers for (int i = 0; i < answers.length; i++) { // Grade one student int correct Count = 0; for (int j = 0; j < answers [i].length; j++) { if keys [j]) (answers[i][j] correct Count++; correctCount); // Key to the questions char[] keys = {'D', 'B', 'D', 'C', 'C, 'D', 'A', 'E', 'A', 'D'}; to englis System.out.println("Student " + i + "'s correct count is " + S 2-D array 1-D array 24-1201 compare with key er 8 Multidimensional Arrays $260 28 Student O's correct count is 7 Student 1's correct count is 6 Student 2's correct count is 5 Student 3's correct count is 4 Student 4's correct count is 8 Student 5's correct count is 7 Student 6's correct count is 7 Student 7's correct count is 7 Check Point of The statement in lines 5-13 declares, creates, and initializes a two-dimensional array characters and assigns the reference to answers of the char [] [] type. The statement in line 16 declares, creates, and initializes an array of char values and assigns the reference to keys of the char[] type. Each row in the array answers stores a student's answer, which is graded by comparing it with the key in the array keys. The result is displayed immediately after a student's answer is graded. 8.5.1 How do you modify the code so it also displays the highest count and the student with the highest count? 8.6 Case Study: Finding the Closest Pair This section presents a geometric problem for finding the closest pair of points. Key Point choice test 8.5 Case Study: Grading a Multiple-Choice Test The problem is to write a program that will grade multiple-choice tests. pne Suppose you need to write a program that grades multiple-choice tests. Assume there are eight students and ten questions, and the answers are stored in a two-dimensional array. Each row records a student's answers to the questions, as shown in the following array: 2222 23 24 25 26 27 2235 28 29 30 31
Expert Answer:
Answer rating: 100% (QA)
The given program is designed to grade a multiplechoice test It compares each students answers with ... View the full answer
Related Book For
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates
Posted Date:
Students also viewed these programming questions
-
The shared theme of these articles relate to the objectives of this course about writing for business?
-
Use the Principle of Induction to prove the formula for all natural numbers \(n\). \(1+2+3+\cdots+n=\frac{n(n+1)}{2}\)
-
What approach should be used to forecast sales if a firm believes that sales will increase over time?
-
Assume that Express Oil Company, a US company, is involved in petroleum operations in Thailand. Express Oil Company has a 40% WI, while the Local Oil Company has a 60% WI. Annual gross production is...
-
Determine the sinking fund depreciation allowance and the book value at the end of each year for a computerized truck tire balancer costing \($18,000\) and having a market value of \($2,000\) after a...
-
Lauren Barton, a single mother with three children, lived in Portland, Oregon. Cynthia VanHorn also lived in Oregon until she moved to New York City to open and operate an art gallery. VanHorn asked...
-
Discuss the rationale and ways in which developers are regulated in relation to the acquisition and development of land in Singapore.
-
MITEL inc is a high-tech company in Ottawa. Over the past 5 years, competition has been fierce for talent in the Ottawa region. In order to attract and retain talent, they have a defined benefit...
-
I was given the following information. Should I include it in my Cash Budget and/or in my Income Statement Budgeted? How should it be showed? Received a $2,000 royalty and issued 1000 common shares...
-
difference in how costs of good sold and gross margin/profit are calculated under financial accounting vs. how contribution margin is calculated under managerial accounting (i.e., what costs are...
-
The COSO framework of internal controls is practiced within companies around the world. The objectives of the COSO framework are closely related to its five components. For this assignment, please...
-
compare and contrast case study and surveys in psychology?
-
Define psychology as a science and its components? Also write 10 reasons why psychology is a science ?
-
The end of a tank containing water is vertical and has the shape of a half-circle of a radius of 10 m. Determine the hydrostatic force against the end of the tank. -10 10 -10
-
The 2017 financial statements of the U.S. government are available at: https://www.fiscal.treasury.gov/fsreports/rpt/finrep/fr/fr_index.htm Use these to answer the following questions: a. Statement...
-
In this exercise, youll develop several brute-force approaches to solving the Eight Queens problem introduced in Exercise 6.24. a) Use the random brute-force technique developed in Exercise 6.23 to...
-
In the AccountTest class of Fig.7.9, method main contains six statements (lines 1112, 1314, 2627, 2829, 3839 and 4041) that each display an Account objects name and balance. Study these statements...
-
Modify the postfix evaluator program of Exercise 21.13 so that it can process integer operands larger than 9. Exercise 21.13 Write class PostfixEvaluator that evaluates a postfix expression such as 6...
-
One of the disadvantages of the IEEET1 exciter is following a fault the terminal voltage does not necessarily return to its prefault value. Using PowerWorld Simulator case Problem 12_3 determine the...
-
Obtain a copy of the ACAS Code of Practice 1: Disciplinary and Grievance Procedures (2009). Use this, and our suggestions in this chapter, to rewrite or modify either of the procedures you used for...
-
Rework Example 13.6 if the source impedance at the sending end of line \(\mathrm{A}\) is \(\mathrm{Z}_{\mathrm{G}}=\mathrm{Z}_{\mathrm{A}} / 4=100 \Omega\), and the receiving end of line...
Study smarter with the SolutionInn App