Write a program to accomplish the following: One of your professors has asked you to write a program to grade her final exams which consist of 20 multiple choice questions. Each question has one of four possible answers: A, B, C, or D. The file "correctAnswers.txt" contains the correct answers for all 20 questions. All 20 answers are written on one line in the file. Write a program that reads the contents of CorrectAnswers.txt into a char array, then reads the contents of another file containing the students' names and answers. This second file is named "studentAnswers.txt" and has the following format: StudentAnswers.txt contains data for an entire class of students. There is one student's information on each line in the file. Each line contains the student's last name followed by student answers to the test questions (always 20 answers). The student's last name will not have any spaces. You may assume it is a single "word". A sample is given below: Smith A BCDBCDBBB C DAAABDDAD Jones ACCDCCDABBCDAAABCCAD A sample of each file is provided on Blackboard for studentAnswers.txt and correctAnswers.txt. For each student in the studentAnswers.txt file the program should determine the number of questions that the student missed, then display the following: (a sample output is given at the end of this assignment) A row of "equal signs" as a separator to clearly show the beginning of each student's separate report. The student name • Aline which reads "Missed Questions" • A line which reads "Question Given Correct" • A row of dashes separating the previous two lines from the data list. Below the row of dashes for each student display a list of question numbers that were missed, the answer given, and the correct answer. Below the list of missed questions, display if the student passed or failed, and then the percentage of correct answers in parentheses. 70% is a passing grade. Your program should handle any number of students, up to a maximum of 50 students (that is, it should work even if the input file had, say, 10 or 30 students). If the file has more than 50 students, your program should only read the first 50). In other words, your file should read students until it reaches the end of file, or 50 students if the file contains more than 50 students. Note additional requirements below: 1. For the Jones student in the sample output, notice that no questions were missed. In this scenario, you should produce the output as shown (with the title "Missed Questions:" followed by "None". 2. Follow all previous documentation and formatting requirements. 3. You must divide the program into functions. Part of your grade will depend on how well your code is structured/divided into meaningful functions. 4. Use formatting tools like setw() and "right" / "left". Do not hard-code spaces between output elements.
Write a program to accomplish the following: One of your professors has asked you to write a program to grade her final exams which consist of 20 multiple choice questions. Each question has one of four possible answers: A, B, C, or D. The file "correctAnswers.txt" contains the correct answers for all 20 questions. All 20 answers are written on one line in the file. Write a program that reads the contents of CorrectAnswers.txt into a char array, then reads the contents of another file containing the students' names and answers. This second file is named "studentAnswers.txt" and has the following format: StudentAnswers.txt contains data for an entire class of students. There is one student's information on each line in the file. Each line contains the student's last name followed by student answers to the test questions (always 20 answers). The student's last name will not have any spaces. You may assume it is a single "word". A sample is given below: Smith A BCDBCDBBB C DAAABDDAD Jones ACCDCCDABBCDAAABCCAD A sample of each file is provided on Blackboard for studentAnswers.txt and correctAnswers.txt. For each student in the studentAnswers.txt file the program should determine the number of questions that the student missed, then display the following: (a sample output is given at the end of this assignment) A row of "equal signs" as a separator to clearly show the beginning of each student's separate report. The student name • Aline which reads "Missed Questions" • A line which reads "Question Given Correct" • A row of dashes separating the previous two lines from the data list. Below the row of dashes for each student display a list of question numbers that were missed, the answer given, and the correct answer. Below the list of missed questions, display if the student passed or failed, and then the percentage of correct answers in parentheses. 70% is a passing grade. Your program should handle any number of students, up to a maximum of 50 students (that is, it should work even if the input file had, say, 10 or 30 students). If the file has more than 50 students, your program should only read the first 50). In other words, your file should read students until it reaches the end of file, or 50 students if the file contains more than 50 students. Note additional requirements below: 1. For the Jones student in the sample output, notice that no questions were missed. In this scenario, you should produce the output as shown (with the title "Missed Questions:" followed by "None". 2. Follow all previous documentation and formatting requirements. 3. You must divide the program into functions. Part of your grade will depend on how well your code is structured/divided into meaningful functions. 4. Use formatting tools like setw() and "right" / "left". Do not hard-code spaces between output elements.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
See attached images
C++
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY