1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Marianna [84]
3 years ago
9

Driver’s License Exam The local driver’s license office has asked you to create an application that grades the written portion o

f the driver’s license exam. The exam has 20 multiple-choice questions. Here are the correct answers: 1. A 6. B 11. A 16. C 2. C 7. C 12. D 17. B 3. A 8. A 13. C 18. B 4. A 9. C 14. A 19. D 5. D 10. B 15. D 20. A Your program should store these correct answers in a list. The program should read the student’s answers for each of the 20 questions from a text file and store the answers in another list.
Computers and Technology
1 answer:
Aleks04 [339]3 years ago
3 0

Driver’s License Exam The local driver’s license office has asked you to create an application that grades the written portion of the driver’s license exam.

Explanation:

  • The exam has 20 multiple-choice questions. Here are the correct answers: 1. A 6. B 11. A 16. C 2. C 7. C 12. D 17. B 3. A 8. A 13. C 18. B 4. A 9. C 14. A 19. D 5. D 10. B 15. D 20. A Your program should store these correct answers in a list.
  • The program should read the student’s answers for each of the 20 questions from a text file and store the answers in another list.

import java.util.*;

class DriverExam{

char[] answer = new char[]{ 'B','D','A','A','C','A','B','A','C','D','B','C','D','A','D','C','C','B','D','A'};

int correct=0,inCorrect=0;

int[] missed = new int[20];

boolean passed(){

if(this.correct >= 15){

return true;

}

return false;

}

int totalCorrect(){

return this.correct;  

}

int totalIncorrect(){

return this.inCorrect;

}

int[] questionsMissed(){

return this.missed;

}

}

public class Main

{

  public static void main(String[] args) {

  Scanner in = new Scanner(System.in);

      System.out.println("Input : A,B,C,D");

System.out.println("Note : Any other inputs will result in skipping that question");

      DriverExam exam = new DriverExam();

      int i,missedIndex=0;

      for(i=0;i<20;i++){

      System.out.print("Answer "+(i+1)+" : ");

      char check = in.next().charAt(0);

      if(exam.answer[i]==check){

      (exam.correct)++;

      }

You might be interested in
suppose as a head software engineer you assign the job of creating a class to a subordinate. You want to specify thirty-eight di
Goryan [66]

Answer:

jskjsjsjsjskdmsnjsnsnsns

8 0
3 years ago
Do you watch markiplier?
ki77a [65]

Answer: Yes

Explanation: He is cool

5 0
3 years ago
Read 2 more answers
Common features of a thunderstorm are _____. thunder lightning rain or hail all of the above
Semmy [17]
All of the above
---------------------------------

8 0
3 years ago
Read 2 more answers
A software program that includes tools for entering, editing, and formatting text and graphics is called a word processing progr
shtirl [24]

i think the answer is true

7 0
2 years ago
1. A truck leaves a stop sign and accelerates uniformly over a time of 5.21 seconds for a
Rufina [12.5K]

Answer:

1, is 21.11 meters per second.

110/5.21

Explanation:

3 0
3 years ago
Other questions:
  • ___ is the branch of computer science that explores techniques for incorporating aspects of intelligence into computer systems.
    5·1 answer
  • What is a critique of the feature detector model of object recognition?​?
    8·1 answer
  • You work in a customer call center. Martin is on the phone asking about the difference between solid-state drives (SSDs), hybrid
    6·1 answer
  • Universal Containers is implementing a community of High-Volume Community users. Community users should be able to see records a
    12·1 answer
  • Object-oriented programs employ a group of techniques for handling errors called ________ handling.
    12·1 answer
  • Although designed to support remote dial-in access to a corporate network, what service below is commonly used with 802.1x port
    12·1 answer
  • The World Wide Web is full of unstructured data. Search engines like Google, Bing and Yahoo have been doing a good job of allowi
    6·1 answer
  • .In Python, comments begin with the comment marker and continue ______.
    14·1 answer
  • Read the scenario and then answer the question using only the information provided.
    7·1 answer
  • Fre.....ee p......oint....s pt 2
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!