Question

zoow Drivers License Exam The local Registry of Motor Vehicles oflice has asked you to create an application that grades the

Visual Basic

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code:


Public Class Form1

Public strGrades() As String = {"B", "D", "A", "A", "C", "A", "B", "A", "C", "D", "B", "C", "D", "A", "D", "C", "C", "B", "D", "A"}
Public strInput(0 To 19) As String

Private Sub btnScore_Click(sender As Object, e As EventArgs) Handles btnScore.Click

strInput(0) = TextBox1.Text
strInput(1) = TextBox2.Text
strInput(2) = TextBox3.Text
strInput(3) = TextBox4.Text
strInput(4) = TextBox5.Text
strInput(5) = TextBox6.Text
strInput(6) = TextBox7.Text
strInput(7) = TextBox8.Text
strInput(8) = TextBox9.Text
strInput(9) = TextBox10.Text
strInput(10) = TextBox11.Text
strInput(11) = TextBox12.Text
strInput(12) = TextBox13.Text
strInput(13) = TextBox14.Text
strInput(14) = TextBox15.Text
strInput(15) = TextBox16.Text
strInput(16) = TextBox17.Text
strInput(17) = TextBox18.Text
strInput(18) = TextBox19.Text
strInput(19) = TextBox20.Text

compare()

End Sub

Sub compare()
Dim intCount As Integer
Dim intCorrect As Integer = 0
Dim decPercent As Integer = 0

For intCount = 0 To (strInput.Length - 1)
If strGrades(intCount) = strInput(intCount) Then
intCorrect += 1
End If
Next intCount

If intCorrect >= 14 Then
lblResult.Text = "Correct" & Environment.NewLine & " " & intCorrect & Environment.NewLine & "Pass"
Else
lblResult.Text = "Correct" & Environment.NewLine & " " & intCorrect & Environment.NewLine & "Fail"
End If
End Sub

Private Sub btnClear_Click(sender As Object, e As EventArgs) Handles btnClear.Click
EmptyInput()
End Sub
Sub EmptyInput()
Dim intCount3 As Integer

For intCount3 = 0 To 19
strInput(intCount3) = String.Empty
Next intCount3

TextBox1.Text = String.Empty
TextBox2.Text = String.Empty
TextBox3.Text = String.Empty
TextBox4.Text = String.Empty
TextBox5.Text = String.Empty
TextBox6.Text = String.Empty
TextBox7.Text = String.Empty
TextBox8.Text = String.Empty
TextBox9.Text = String.Empty
TextBox10.Text = String.Empty
TextBox11.Text = String.Empty
TextBox12.Text = String.Empty
TextBox13.Text = String.Empty
TextBox14.Text = String.Empty
TextBox15.Text = String.Empty
TextBox16.Text = String.Empty
TextBox17.Text = String.Empty
TextBox18.Text = String.Empty
TextBox19.Text = String.Empty
TextBox20.Text = String.Empty
lblResult.Text = String.Empty

End Sub

Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
Me.Close()

End Sub
End Class

Output:

Form1 11: B 16: C Cormect 20 Pass 12: C 2: D 17: C 13: D 18: B 4: A 9: C 14: A 19: D 5: C 10: D 20: A 15: D Score Exam Clear

Add a comment
Know the answer?
Add Answer to:
Visual Basic zoow Driver's License Exam The local Registry of Motor Vehicles oflice has asked you to create an application that grades the written portion of the driver's license exam. The ex...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using C++ 1. Driver's The local driver's license office has asked you to create an application...

    Using C++ 1. Driver's The local driver's license office has asked you to create an application that grades the written portion of the driver's license exam. The exam has 20 multiple-choice questions. Here are the correct answers 16. C 17.С 18. B 19. D 20. A 1. B 2. D 3. A 12. C 13. D 14. A 15. D 7.В 9.С 10. D 5. С Your program should store these correct answers in an array. It should ask the...

  • C# Visual Studio -The local driver's license office has asked you to create an application that...

    C# Visual Studio -The local driver's license office has asked you to create an application that grades the written portion of the driver's license exam. The exam has 20 multiple choice questions. Here are the correct answers: 1. B 2. D 3. A 4. A 5. C 6. A 7. B 8. A 9. C 10. D 11. B 12. C 13. D 14. A 15. D 16. C 17. C 18. B 19. D 20. A Your program should...

  • please only use import java.util.Scanner Driver's License Exam The local Driver's License Office has asked you...

    please only use import java.util.Scanner Driver's License Exam The local Driver's License Office has asked you to write a program that grades the written portion of the driver's license exam. The exam has 20 multiple choice questions. Here are the correct answers: 1. A 2. D 3.В 4. B 5, C 6. В 7. A 8.В 9, C 10. D 12. C 13. D 14. B 15. D 16. С 18. A 19. D 20. B Your program should store...

  • Java: The local Driver's License Office has asked you to write a program that grades the...

    Java: The local Driver's License Office has asked you to write a program that grades the written portion of the driver's   license exam. The exam has 20 multiple choice questions.   Here are the correct answers:    1. B  6. A  11.B  16. C    2. D  7. B  12.C  17. C    3. A   8. A  13.D  18. B    4. A  9. C  14.A  19. D    5. C  10. D  15.D  20. A    Your program should store the correct answers in an array. (Store each question's answer in an element of a String array.) The program...

  • License test The Los Angeles driver's license office has asked you to create an application that...

    License test The Los Angeles driver's license office has asked you to create an application that grades the written portion of the drivers license test. The test has 15 multiple-choice questions. Here are the correct answers (You may create your own correct answers if you like) 1. C 2. D     3. B 4. A      5. C 6. D 7. B     8. A     9. C     10. D 11. A 12. C   13. D    14. A     15. B A student must answer 10...

  • PYTHON CODE PLEASEEEEE. Driver’s License Exam 20PTS PYTHON AND FLOWCHART The local driver’s license office has...

    PYTHON CODE PLEASEEEEE. Driver’s License Exam 20PTS PYTHON AND FLOWCHART The local driver’s license office has asked you to design a program that grades the written portion of the driver’s license exam. The exam has 20 multiple choice questions. Here are the correct answers: 1.B 6.A 11.B 16.C 2.D 7.B 12.C 17.C 3.A 8.A 13.D 18.B 4.A 9.C 14.A 19.D 5.C 10.D 15.D 20.A Your program should store these correct answers in an array. (Store each question’s correct answer in...

  • The local driver’s license office has asked you to write a program that grades the written...

    The local driver’s license office has asked you to write a program that grades the written portion of the driver’s license Rules and Signals Test. The driver license test has 25 multiple choice questions. The set of answer keys is: 1.A 6.B 11.C 16.B 2 21.B 2.C 7.C 12.A 17.A 22.C 3.B 8.D 13.B 18.C 23.A 4.B 9.A 14.C 19.A 24.D 5.D 10.B 15.A 20.D 25.B First, the application displays messages to ask for the information of current candidate about...

  • Please answer Question 4 WITH A C# PROGRAM!!!!!! THANK YOU! File Edit View History Bookmarks Tools...

    Please answer Question 4 WITH A C# PROGRAM!!!!!! THANK YOU! File Edit View History Bookmarks Tools Help Share GEP IIIA Moorhead, MN 10-Day Weathe X N NDSU Faculty and Staff | North x D C#.NET - CSCI 213: Modern Sol X VitalSource Bookshelf: Starting x + + → OO - https://bookshelf.vitalsource.com/#/books/9780134400433/cf1/6 90% *** * Cambie Meble alle... S N 10 Crosby Derek Lam ... Alterna Caviar Anti-Ag... U C# Tutorial For Beginn... BE Celsius Fahrenheit con... Charter Club Sweater. Folklorama...

  • You have been asked to write a program to grade several multiple-choice exams. The exam has...

    You have been asked to write a program to grade several multiple-choice exams. The exam has 20 questions, each answered with a letter in the range of ‘a’ through ‘f’. The answers key is declared in the program as constant of type string. An example of answer key is “abcdefabcdefabcdefab”. Your program should work for any other answer key. The program should first ask users for the number of students to be graded. Then it should have a while loop...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT