To be done in C++ The only part I need done is the portion where it reads an existing students txt and allows the user to add additional students to it I have everything else   Brief Description: This program will ask the user to enter details about a class of students, one student at a time. These details include first name, last name, age, and grade. The user should be able to add up to 10 students, which will be stored in an array of structs.   Details: The program should first ask the user how many students they wish to enter, up to 10. If a user enters a number less than 1 or greater than 10, the program should keep asking the user the number of students until the number is between 1 and 10. Once this information is known, the program should proceed to ask for each student’s first name, last name, age, and grade. Once all the student information has been entered by the user, the program should output all the student information to a file called “students.txt”. For each student entered, this file should contain 4 lines of information. The first line should be the first name. The second line should be the last name. The third line should be the age. The fourth line should be the grade. So, for example, if my class contains a student named Jane Doe, age 20, with a grade of 94.3, this would appear in the “students.txt” file as: Jane Doe 20 94.3 and a similar entry would be present in the file for all the other students.     Specific Implementation Requirements: 1. An array of structs should be used to store the students in memory. The structs should each contain two character arrays (for the first and last name), one integer (for the age), and one float or double (for the grade). 2. The code which writes the data to the output file should not be in main. 3. A comment block should be present before each function, explaining what the function does. 4. Comments should be present within each function, explaining any possibly confusing code. 5. The program should properly compile and run without crashing. 6. The program should properly store names, ages, and grades without any loss of data (e.g., if I enter a grade of 9.4, but your program only stores 9, you’ve lost data)   Add a feature to your program which reads in an existing “students.txt” and allows the user to add additional students to it. The program should, before asking the user to input the number of students, ask the user if they wish to load an existing file. If the user says yes, your program should read in the existing file, and then ask the user how many additional students they wish to add (but in any case the user should not be allowed to have more than 10 students, including existing and new). If the user declines to load the existing “students.txt” file, your program should proceed as normal.

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
To be done in C++ The only part I need done is the portion where it reads an existing students txt and allows the user to add additional students to it I have everything else
 
Brief Description:
This program will ask the user to enter details about a class of students, one student at a time. These details include first name, last name, age, and grade. The user should be able to add up to 10 students,
which will be stored in an array of structs.
 
Details:
The program should first ask the user how many students they wish to enter, up to 10. If a user enters a number less than 1 or greater than 10, the program should keep asking the user the number of students until the number is between 1 and 10. Once this information is known, the program should proceed to ask for each student’s first name, last name, age, and grade. Once all the student information has been entered by the user, the program should output all the student information to a file called “students.txt”. For each student entered, this file should contain 4 lines of
information. The first line should be the first name. The second line should be the last name. The third line should be the age. The fourth line should be the grade. So, for example, if my class contains a student named Jane Doe, age 20, with a grade of 94.3, this would appear in the “students.txt” file as:
Jane
Doe
20
94.3
and a similar entry would be present in the file for all the other students.
 
 
Specific Implementation Requirements:
1. An array of structs should be used to store the students in memory. The structs should each contain two character arrays (for the first and last name), one integer (for the age), and one float or double (for the grade).
2. The code which writes the data to the output file should not be in main.
3. A comment block should be present before each function, explaining what the function does.
4. Comments should be present within each function, explaining any possibly confusing code.
5. The program should properly compile and run without crashing.
6. The program should properly store names, ages, and grades without any loss of data (e.g., if I enter a grade of 9.4, but your program only stores 9, you’ve lost data)
 
Add a feature to your program which reads in an existing “students.txt” and allows the user to add additional students to it. The program should, before asking the user to input the number of students, ask the user if they wish to load an existing file. If the user says yes, your program should read in the existing file, and then ask the user how many additional students they wish to add (but in any case the user should not be allowed to have
more than 10 students, including existing and new). If the user declines to load the existing “students.txt” file, your program should proceed as normal.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
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