(1) Generate a data file to save students\' grades. Allow the user to enter id,
ID: 3620530 • Letter: #
Question
(1) Generate a data file to save students' grades. Allow the user to enter id, name and grade of each student as well as the total number of students. There should be a header as the first row. Here is an example.ID NAME GRADE
01 Mary 100.00
02 Tom 98.35
03 John 88.99
......
(2) If the grade is <0 or >100, ask the user to re-enter the correct grade.
(3) After the data file is generated, read the file and print the content to the screen.
Use one program to complete the tasks.
Assignment #2 is due by october 16.
Explanation / Answer
#include #include using namespace std; int main() { ofstream out; out.open("Studentgrade.txt"); int total; int id; int grade; string name; do { coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.