Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q4) (30 pts.) Assume that you have two files given : answer.txt and key.txt files. answer.txt file includes students number (int) and the answers of
Q4) (30 pts.) Assume that you have two files given : answer.txt and key.txt files. answer.txt file includes students number (int) and the answers of the students. key.txt file includes the answer key for 100 questions. Write a complete C program that reads the exam answers of the students from the file answers.txt, and then compare these answers with the correct answers in key.txt. Outputs the Score of each student based on their correct answers. Finally displays Pass if the number of correct answers of the student is above 50, and displays Fail if the number of correct answers of the student is below 50. Hint: You may use a string (char[] ) to store the answers. answers.txt: 1457 abdaa... 1468 bbadc... 1463 abbdc... key.txt: abbacaca... The program output may be displayed as follows for 5 questions: stno : 1457 Score: 3 Pass stno : 1468 Score: 2 Fail stno: 1463 Score: 4 Pass
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started