Question
INTRODUCTION TO C++ Here i attached a picture of what is in the file grades.txt which is needed for this program to work. The question
INTRODUCTION TO C++
Here i attached a picture of what is in the file grades.txt which is needed for this program to work. The question will be below this picture.
Question: Write a C++ program that asks for both a file and name of a student. Then: If you cannot open the file, display File does not exist. and stop the program. If the student is not in the file, display No student with that name. If the student is in the file, show their grade. You may assume the format of the file is the same as the given example grades.txt. You cannot make any assumptions on the number of students in the file. You can assume each students name in the file is unique.
Example 1 (user input is bold and italic): What file? iDontExist.txt Whose name? Jacob File does not exist.
Example 2 (user input is bold and italic: What file? grades.txt Whose name? Jacob No student with that name.
Example 3 (user input is underlined): What file? grades.txt Whose name? Anisha Grade: C
James : 67.34: D+ : Senior Maximilian: 93.23 : A : Junior Gal : 85.94 : B: Sophomore Fox : 23.10: F Senior Baldo: 99.99 : A : Freshman Emyr : 94.33 A : Senior Grigorii : 75.29 : C : Junior Ibb: 88.41 : B+: Freshman Gerardo : 71.93 C- Freshman Sonam : 84.11 : B : Freshman Fabiana : 91.49 : A- : Junior Shams : 83.83 : B: Senior Filip: 13.45 : F: Sophomore Anisha: 74.12 : C: Senior Kilian : 63.41 : D : Sophomore Tamatoa: 95.00: A : Junior Gurmeet : 74.20 : C : Sophomore Aminda: 83.13 : B :Senior Lubomir: 81.30 : B- : Freshman Miguela : 74.20 : C : Senior Bernard : 89.58 : Junior James : 67.34: D+ : Senior Maximilian: 93.23 : A : Junior Gal : 85.94 : B: Sophomore Fox : 23.10: F Senior Baldo: 99.99 : A : Freshman Emyr : 94.33 A : Senior Grigorii : 75.29 : C : Junior Ibb: 88.41 : B+: Freshman Gerardo : 71.93 C- Freshman Sonam : 84.11 : B : Freshman Fabiana : 91.49 : A- : Junior Shams : 83.83 : B: Senior Filip: 13.45 : F: Sophomore Anisha: 74.12 : C: Senior Kilian : 63.41 : D : Sophomore Tamatoa: 95.00: A : Junior Gurmeet : 74.20 : C : Sophomore Aminda: 83.13 : B :Senior Lubomir: 81.30 : B- : Freshman Miguela : 74.20 : C : Senior Bernard : 89.58 : JuniorStep 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