Write a C program that will get 10 grades of the student from a file named grades.txt. The program will check each grade if its passing, failing or invalid. Passing grade is 70-100. Failing grade is 0-69. Other value will be considered invalid. Store all the passing grade to an output file named passed.txt. Store all the failing grades to an output file named failed.txt. And store all the invalid grades to another output file named invalid.txt. The program must comply with the given sample output below: NOTE: Filename to read: grades.txt Filename to write: passed.txt, failed.txt, invalid.txt NOTE: Your source code must display any of the given sample output below. It means your source code should be flexible enough to meet any of the given sample output. Your source code output must be identical to any of the given sample output. It means you have to strictly follow what are the displayed text, labels, casing of characters in the sample output. Strictly follow the naming of file.
Task 3: Reading and Writing a File
Write a C
NOTE:
Filename to read: grades.txt
Filename to write: passed.txt, failed.txt, invalid.txt
NOTE:
Your source code must display any of the given sample output below.
It means your source code should be flexible enough to meet any of the given sample output.
Your source code output must be identical to any of the given sample output.
It means you have to strictly follow what are the displayed text, labels, casing of characters in the sample output.
Strictly follow the naming of file.
Required Outputs is attached
![Sample OUTPUT1:
Sample OUTPUT2:
Enter File Name: grades.txt
Enter File Name: grades.txt
All grades are evaluated and stored in their respective files.
All grades are evaluated and stored in their respective files.
DISPLAY FILE MENU
DISPLAY FILE MENU
[1] Passing
[1] Passing
[2] Failing
[2] Failing
[3] Invalid
[3] Invalid
Option: 1
Option: 2
Passing Grades: 100, 90, 70, 99,
Failing Grades: 50, 0, 69, 1,
Sample OUTPUT3:
Sample OUTPUT4:
Enter File Name: grades.txt
Enter File Name: grades.txt
All grades are evaluated and stored in their respective files.
All grades are evaluated and stored in their respective files.
DISPLAY FILE MENU
DISPLAY FILE MENU
[1] Passing
[1] Passing
[2] Failing
[2] Failing
[3] Invalid
[3] Invalid
Option: 3
Option: 4
Invalid Grades: 101, -1,
Invalid Option
Sample OUTPUT5:
Enter File Name: grade.txt
The file can't be open. File does not exists.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F50f2e7f7-dab8-43c3-9b96-7c7ac1bfb4de%2Ffd6b4601-c118-4e60-9e6d-7d5a450e9556%2Fqepcvim_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 6 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)