Question
MUST BE C++ PROGRAM Create a constant with the MAX number of students (set to 10). Create an enum Year (values: Freshman, sophomore, Junior &
MUST BE C++ PROGRAM
Create a constant with the MAX number of students (set to 10).
Create an enum Year (values: Freshman, sophomore, Junior & Senior).
Create function GetYearString that returns a string based on a Year enum value.
Create struct Student that includes variables: a string for students full name, an int for number of credits and a Year enum for which year they are in.
Make an array of Student structs to hold the data. Use an appropriate loop to read in up to (MAX) number of credits and names from the file Students.txt. Stop early if a blank name is entered. Please place this file in the same folder as the .sln file. It can be accessed using ..\\students.txt as the path.
Create a function getYearEnum that returns a Year enum in the return value of the function with its only parameter being the number of credits.
The return value returned is based on the number of credits they have:
0 30 Freshman
31 60 Sophomore
61 90 Junior
91 + Senior
Loop thru the array in main updating the array with each students year.
Next create a printStudent function that takes a Student struct reference as a parameter and prints out a single student.
Use the printStudent function on a loop to create an interim report. It needs to provide the students name, number of credits, and the year they are in nicely formatted with aligned columns. (see exact output required below)
Create a printFinal void function that prints out the totals below. This function must do the calculation of the total credits and the number of seniors. The Final report should be formatted (see exact output required below), and provides the following:
1. Total number of students
2. Total credits
3. Total number of seniors
EXAMPLE
Interim Report: Name Credits Year Clark Kent 15 Freshman Bruce Wayne 63 Junior more rows here
Final Report: Total number of students: 8 Total credits: 435 Total number of seniors: 1 MUST BE C++ PROGRAM
Step 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