Question: Write a C++ programm Part - I 1. Declare following arrays i. Integer array of size 10 ii. An array of size 5 with following

Write a C++ programm

Part - I

1. Declare following arrays

i. Integer array of size 10

ii. An array of size 5 with following initial vales (1.0, 34.6, 7.8, 8.9, 0)

iii. String array cable of storing 5 names

Part II

2. Using Arrays: Drivers License test Grader System

The local Drivers License Office has asked you to write a program that grades the written portion of the drivers license test. The test has 10 multiple choice questions. Here, are the correct answers:

1. B6. A

2. D7. B

3. A8. A

4. A9. C

5. C 10. D

Your program should store the correct answers shown above in a character array named correctAnswers (In this assignment you are not doing any string manipulation, so the Answer array can be a simple character array, not a string).

Then, it should ask the user to enter the students answers for each of the 10 questions, and the answers should be stored in another array named studentAnswers.

In order to pass the test a student must answer at least 8 questions out of 10. So, the grade function checks the entries in both array and determine if the student has answered at least 8 questions correctly.

If student has passed the test, your program should display the following message

Congratulations!

You have passed test.

Total number of correct answers: < >

Total number of incorrect answers: < >

If student has failed the test, your program should display the following message

Sorry, you have not passed the test!

Total number of correct answers: < >

Total number of incorrect answers: < >

Input validation: Only accept the letters A, B, C, or D as answers. If user enters any other letter, your program should display a message indicating A, B, C, and D are the only valid inputs. If user enters invalid input more than three times display the message

GOOD BYE and exit the program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!