1. Write a C++ program that reads a student grade from the screen/keyboard. The program should then use the input grade as a search key to look for the list of students with matching grade in a text file (file.txt). Each record of the student data in the text file consists of matric number and grade. Print the list of matric numbers for students whose grades match the search key value and the number of students with grades A, B, C, D and F on the screen. Do not use array in the program. An example of the text file (file.txt) is as follows. 66756 A 78954 B 64528 A 59576 F 87412 A 76532 B 79475 C 73645 B 67355 A 88756 C 63849 A If the input grade (i.e. the search key) is A, the input/output screen produced should be displayed as follows. Underlined and bold item is user input. Enter grade (search key): A 56700 D 93769 A The matric number of students with grade A: 66756 64528 87412 63849 93769 67355 Number of students with grade A: 6 Number of students with grade B: 3 Number of students with grade C: 2 Number of students with grade D: 1 Number of students with grade F: 1

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
1.
Write a C++ program that reads a student grade from the screen/keyboard. The
program should then use the input grade as a search key to look for the list of
students with matching grade in a text file (file.txt). Each record of the student
data in the text file consists of matric number and grade. Print the list of matric
numbers for students whose grades match the search key value and the number of
students with grades A, B, C, D and F on the screen. Do not use array in the
program.
An example of the text file (file.txt) is as follows.
66756 A 78954 B 64528 A 88756 C
59576 F 87412 A 76532 B
63849 A
79475 C 73645 B
67355 A
If the input grade (i.e. the search key) is A, the input/output screen produced
should be displayed as follows. Underlined and bold item is user input.
Enter grade (search key): A
56700 D
93769 A
The matric number of students with grade A:
66756
64528
87412
63849
93769
67355
Number of students with grade A: 6
Number of students with grade B: 3
Number of students with grade C: 2
Number of students with grade D: 1
Number of students with grade F: 1
Transcribed Image Text:1. Write a C++ program that reads a student grade from the screen/keyboard. The program should then use the input grade as a search key to look for the list of students with matching grade in a text file (file.txt). Each record of the student data in the text file consists of matric number and grade. Print the list of matric numbers for students whose grades match the search key value and the number of students with grades A, B, C, D and F on the screen. Do not use array in the program. An example of the text file (file.txt) is as follows. 66756 A 78954 B 64528 A 88756 C 59576 F 87412 A 76532 B 63849 A 79475 C 73645 B 67355 A If the input grade (i.e. the search key) is A, the input/output screen produced should be displayed as follows. Underlined and bold item is user input. Enter grade (search key): A 56700 D 93769 A The matric number of students with grade A: 66756 64528 87412 63849 93769 67355 Number of students with grade A: 6 Number of students with grade B: 3 Number of students with grade C: 2 Number of students with grade D: 1 Number of students with grade F: 1
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education