The State Department of Motor Vehicles (DMV) has asked you to write a program that grades...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The State Department of Motor Vehicles (DMV) has asked you to write a program that grades the written portion of the driver's license exam, which has 20 multiple choice ques- tions. 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 To do this you should create a TestGrader class. The class will have an answers array of 20 characters, which holds the correct test answers. It will have two public member functions that enable user programs to interact with the class: setKey and grade. The setKey function receives a 20-character string holding the correct answers, and copies this information into its answers array. The grade function receives a 20-character array holding the test taker's answers and compares each of their answers to the correct one. After "grading" the exam, the function should display a message indicating whether the applicant passed or failed the exam. An applicant must correctly answer 15 or more of the 20 questions to pass the exam. The function should then display the total number of correctly answered questions, the total number of incorrectly answered questions, and a list of the question numbers for all incorrectly answered questions. The client program that creates and uses a TestGrader object should first make a single call to setKey, passing it a string containing the 20 correct answers. Once this is done it should allow a test taker's 20 answers to be entered, store them in a 20-character array, and then call the grade function to grade the exam. The program should loop to allow additional tests to be entered and graded until the user indicates a desire to quit. Input Validation: Only accept the letters A,B,C, and D for the test answers. The State Department of Motor Vehicles (DMV) has asked you to write a program that grades the written portion of the driver's license exam, which has 20 multiple choice ques- tions. 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 To do this you should create a TestGrader class. The class will have an answers array of 20 characters, which holds the correct test answers. It will have two public member functions that enable user programs to interact with the class: setKey and grade. The setKey function receives a 20-character string holding the correct answers, and copies this information into its answers array. The grade function receives a 20-character array holding the test taker's answers and compares each of their answers to the correct one. After "grading" the exam, the function should display a message indicating whether the applicant passed or failed the exam. An applicant must correctly answer 15 or more of the 20 questions to pass the exam. The function should then display the total number of correctly answered questions, the total number of incorrectly answered questions, and a list of the question numbers for all incorrectly answered questions. The client program that creates and uses a TestGrader object should first make a single call to setKey, passing it a string containing the 20 correct answers. Once this is done it should allow a test taker's 20 answers to be entered, store them in a 20-character array, and then call the grade function to grade the exam. The program should loop to allow additional tests to be entered and graded until the user indicates a desire to quit. Input Validation: Only accept the letters A,B,C, and D for the test answers.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
The file OIL.GDP.xls contains annual time series data for country Z in Africa. The variables in this data set are: Inflation ( INFL ) measured as a percentage, oil price ( OILP ) measured in dollars...
-
One molecule is observed for 20 seconds, and follows From the above set of data, estimate the probability that a molecule that is inside a cell leaves during a given second, and the probability that...
-
Table B.4 presents data for 27 houses sold in Erie, Pennsylvania. a. Fit a simple linear regression model relating selling price of the house to the current taxes ( x1 ). b. Test for signifi cance of...
-
Lowell Inc. projects unit sales for a new project with a life of FOUR YEARS as follows: year 1 = Unit sales 10,000 Year 2 = Unit sales 12,000 Year 3 = Unit sales 14,000 Year 4 = Unit sales 16,000...
-
Seal Polymer Industries sold two freight containers of latex gloves to Med- Express, Inc., a company based in North Carolina. When Med- Express failed to pay the $ 104,000 owed for the gloves, Seal...
-
One hundred one-acre test plots are being used to assess the yield potential of a new variety of wheat genetically engineered by Washington State University. The actual yield-per-acre observations on...
-
Where do you stand on the issue of Net Neutrality?
-
Goldstein Inc. manufactures and sells plastic boxes and trays. Sales are projected to be evenly spread over the annual period. Estimated product sales and material needs for each unit of product...
-
MyZ Company is an innovative company that recently invented some new technology that allows AI to work with hospital medical files on patients with severe health conditions. AI analyzes all existing...
-
Jamie Lee and Ross, now 57 and still very active, have plenty of time on their hands now that the triplets are away at college. They both realized that time has just flown by; over twenty-four years...
-
To support herself while attending school, Daun Deloch sold stereo systems to other students. During the first year of operations, Deloch purchased the stereo systems for $163,000 and sold them for...
-
Indicate whether you agree or disagree with the following statements: a. "To determine the theoretical value of an option, we will need some measure of the price volatility of the underlying asset....
-
Explain three arguments against trade protection.
-
Explain three consequences of deflation.
-
For years, observers and analysts of the debt market believed that municipal securities were free of any risk of default. Why do most people now believe that municipal debt can carry a substantial...
-
Explain three potential benefits from international trade.
-
In reviewing the T-account for Accounts Payable, you find that the beginning balance is zero, the total increases are $7,400 and the total decreases are $4,400. This means that the ending balance of...
-
In the current year, the City of Omaha donates land worth $500,000 to Ace Corporation to induce it to locate in Omaha and create an estimated 2,000 jobs for its citizens. a. How much income, if any,...
-
The headquarters of Hill Cist Corporation, a private company with $15.5 million in annual sales, is located in California. Hill Crest provides for its 150 clients an online legal software service...
-
Discuss the concept of exposure and explain why firms may tolerate some exposure.
-
What is meant by inheritance? Give an example.
-
What is meant by the term "active listening"?
-
What does the term "unauthorized practice of law" mean, and how does it limit your relationship with a client?
-
Why is it important to pay attention to cultural differences when interviewing a client?
Study smarter with the SolutionInn App