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++
![studenAnswers.txt
Smith A B совсD вввCD АААВD DAD
Jones A C срссD АВВСD АААВ С СAD
Plumlee A ВсD вс DABBC DAAAB СDАС
Bigelow C B совсD АВВCD A А АВСDAD
North A B CDВCDA ВВCDAA АВСDА D
Rix A B DD BCDABBD DADD BCDDD
Gaddis A АСD ВС ААВВ С АААВ В ССАD
IckySlobongo A A A AA ААА А А АААА А А А ААА
correctAnswers.txt
АВСD B СDАВ В СDАА АВСD АD](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F88ce7fe7-6055-4d88-a2fe-fb962619b6d1%2Fde156a98-99a8-4b15-813a-fc1094207c76%2Flsvtk0a_processed.png&w=3840&q=75)
Transcribed Image Text:studenAnswers.txt
Smith A B совсD вввCD АААВD DAD
Jones A C срссD АВВСD АААВ С СAD
Plumlee A ВсD вс DABBC DAAAB СDАС
Bigelow C B совсD АВВCD A А АВСDAD
North A B CDВCDA ВВCDAA АВСDА D
Rix A B DD BCDABBD DADD BCDDD
Gaddis A АСD ВС ААВВ С АААВ В ССАD
IckySlobongo A A A AA ААА А А АААА А А А ААА
correctAnswers.txt
АВСD B СDАВ В СDАА АВСD АD
![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 fallowing 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 BC DBCDBBBCDAAABDDAD
Jones A CCDCCDABBCDAAABCCAD
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
A line 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,
A.
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 ycur 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.
Sample output for three students is shown below:
====
Student Name: Baker
Missed questions:
Question Given Correct
2
A
10
B
Passed (90% correct)
====-- ==
Student Name: Jones
Missed questions:
None
Passed (100% correct)
Student Name: Lewis
Missed questions:
Question Given Correct
---- -
A
10
B
11
D
12
A
14
B
15
A
16
A.
17
A
B
Failed (60% correct)
..and so one for each student, up to 50 maximum...](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F88ce7fe7-6055-4d88-a2fe-fb962619b6d1%2Fde156a98-99a8-4b15-813a-fc1094207c76%2Fbihbv1_processed.png&w=3840&q=75)
Transcribed Image Text: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 fallowing 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 BC DBCDBBBCDAAABDDAD
Jones A CCDCCDABBCDAAABCCAD
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
A line 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,
A.
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 ycur 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.
Sample output for three students is shown below:
====
Student Name: Baker
Missed questions:
Question Given Correct
2
A
10
B
Passed (90% correct)
====-- ==
Student Name: Jones
Missed questions:
None
Passed (100% correct)
Student Name: Lewis
Missed questions:
Question Given Correct
---- -
A
10
B
11
D
12
A
14
B
15
A
16
A.
17
A
B
Failed (60% correct)
..and so one for each student, up to 50 maximum...
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
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
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
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…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
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)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
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](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY