There are 45 students in a class, and the averages of these students are kept in a "sequential process file". You are asked to write a program like this: When the program is run for the first time, it checks whether the "notes.txt" file exists, if there is no file, it creates the file and writes it in the form of "ID POINT" for 45 students with IDs from 1 to 45 and with score values ​​of 0. So the initial state of the file will be as follows. 1 0 2 0 3 0 ... 44 0 45 0 If the file already exists, the existing file should be opened and the point values ​​in the file should be used. The program will then receive the ID and SCORE from the user and change the grade given to the student with the relevant ID to the current average. If the ID is entered as 0, the program will terminate and the current average values ​​will be written to the file. You can check if the file exists as follows. bool file_varmi(string filename){ Ifstream f(name) Return f.good() } Note: It is sufficient for each student to write their average against their ID number in the file. Hint: you can read the contents of the file with the help of an array and write the array back to the file.     I want only C++ language

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

There are 45 students in a class, and the averages of these students are kept in a "sequential process file". You are asked to write a program like this:
When the program is run for the first time, it checks whether the "notes.txt" file exists, if there is no file, it creates the file and writes it in the form of "ID POINT" for 45 students with IDs from 1 to 45 and with score values ​​of 0. So the initial state of the file will be as follows.
1 0
2 0
3 0
...
44 0
45 0
If the file already exists, the existing file should be opened and the point values ​​in the file should be used. The program will then receive the ID and SCORE from the user and change the grade given to the student with the relevant ID to the current average. If the ID is entered as 0, the program will terminate and the current average values ​​will be written to the file.
You can check if the file exists as follows.
bool file_varmi(string filename){
Ifstream f(name)
Return f.good()
}
Note: It is sufficient for each student to write their average against their ID number in the file.
Hint: you can read the contents of the file with the help of an array and write the array back to the file.

 

 

I want only C++ language

Expert Solution
steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Knowledge Booster
Files and Directory
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
  • SEE MORE 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