4. Task 3: Reading and Writing a File 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. Sample OUTPUT1: Enter File Name: grades.txt All grades are evaluated and stored in their respective files. DISPLAY FILE MENU [1] Passing [2] Failing [3] Invalid Option: 1 Passing Grades: 100, 90, 70, 99, Sample OUTPUT2: Enter File Name: grades.txt All grades are evaluated and stored in their respective files. DISPLAY FILE MENU [1] Passing [2] Failing [3] Invalid Option: 2 Failing Grades: 50, 0, 69, 1, Sample OUTPUT3: Enter File Name: grades.txt All grades are evaluated and stored in their respective files. DISPLAY FILE MENU [1] Passing [2] Failing [3] Invalid Option: 3 Invalid Grades: 101, -1, Sample OUTPUT4: Enter File Name: grades.txt All grades are evaluated and stored in their respective files. DISPLAY FILE MENU [1] Passing [2] Failing [3] Invalid Option: 4 Invalid Option Sample OUTPUT5: Enter File Name: grade.txt The file can’t be open. File does not exists.
4. Task 3: Reading and Writing a File 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. Sample OUTPUT1: Enter File Name: grades.txt All grades are evaluated and stored in their respective files. DISPLAY FILE MENU [1] Passing [2] Failing [3] Invalid Option: 1 Passing Grades: 100, 90, 70, 99, Sample OUTPUT2: Enter File Name: grades.txt All grades are evaluated and stored in their respective files. DISPLAY FILE MENU [1] Passing [2] Failing [3] Invalid Option: 2 Failing Grades: 50, 0, 69, 1, Sample OUTPUT3: Enter File Name: grades.txt All grades are evaluated and stored in their respective files. DISPLAY FILE MENU [1] Passing [2] Failing [3] Invalid Option: 3 Invalid Grades: 101, -1, Sample OUTPUT4: Enter File Name: grades.txt All grades are evaluated and stored in their respective files. DISPLAY FILE MENU [1] Passing [2] Failing [3] Invalid Option: 4 Invalid Option Sample OUTPUT5: Enter File Name: grade.txt The file can’t be open. File does not exists.
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
4. Task 3: Reading and Writing a File
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
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.
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.
Sample OUTPUT1: |
---|
Enter File Name: grades.txt |
All grades are evaluated and stored in their respective files. |
DISPLAY FILE MENU |
[1] Passing |
[2] Failing |
[3] Invalid |
Option: 1 |
Passing Grades: 100, 90, 70, 99, |
Sample OUTPUT2: |
---|
Enter File Name: grades.txt |
All grades are evaluated and stored in their respective files. |
DISPLAY FILE MENU |
[1] Passing |
[2] Failing |
[3] Invalid |
Option: 2 |
Failing Grades: 50, 0, 69, 1, |
Sample OUTPUT3: |
---|
Enter File Name: grades.txt |
All grades are evaluated and stored in their respective files. |
DISPLAY FILE MENU |
[1] Passing |
[2] Failing |
[3] Invalid |
Option: 3 |
Invalid Grades: 101, -1, |
Sample OUTPUT4: |
---|
Enter File Name: grades.txt |
All grades are evaluated and stored in their respective files. |
DISPLAY FILE MENU |
[1] Passing |
[2] Failing |
[3] Invalid |
Option: 4 |
Invalid Option |
Sample OUTPUT5: |
---|
Enter File Name: grade.txt |
The file can’t be open. File does not exists. |
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 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