C++/cpp Exercise: 1- Define a class student with the following fields: a. First name b. Last name c. ID d. Number of courses enrolled in e. Dynamic array of courses (taken and currently enrolled in): String *courses f. Dynamic array of grades: int* grades g. Address h. Registration fees i. Total number of credits j. Expected Graduation term. 2- Declare an array of four students. Perform the following operations using your declared array: a. Open the provided file input.txt. Fill the array by reading values from the specified input file. Make sure that the array of courses and array of grades are initialized properly and destroyed properly as well. b. Call a function that prints student information in a well-organized table like fashion. c. Call a function that compares average between two students. d. Call a function that prints student names based on their GPA from highest to lowest. (hint you need to sort the array of students). e. Call a function that prints student names from lowest GPA to highest. f. Call a function that gives a flat raise of 10 points to all students in one of the subject matters. g. Call a function that gives a raise based on the highest student grade. This means that the highest student grade should be adjusted to 100 and the rest of the students will get new_student_grade= (100*original_student_grade)/highest_student_grade. h. The below code and table are provided to help you create a similar table of students

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

C++/cpp Exercise:

1- Define a class student with the following fields:
a. First name
b. Last name
c. ID
d. Number of courses enrolled in
e. Dynamic array of courses (taken and currently enrolled in): String *courses
f. Dynamic array of grades: int* grades
g. Address
h. Registration fees
i. Total number of credits
j. Expected Graduation term.
2- Declare an array of four students. Perform the following operations using your declared array:
a. Open the provided file input.txt. Fill the array by reading values from the specified input
file. Make sure that the array of courses and array of grades are initialized properly and
destroyed properly as well.
b. Call a function that prints student information in a well-organized table like fashion.
c. Call a function that compares average between two students.
d. Call a function that prints student names based on their GPA from highest to lowest.
(hint you need to sort the array of students).
e. Call a function that prints student names from lowest GPA to highest.
f. Call a function that gives a flat raise of 10 points to all students in one of the subject
matters.
g. Call a function that gives a raise based on the highest student grade. This means that the highest student grade should be adjusted to 100 and the rest of the students will get new_student_grade= (100*original_student_grade)/highest_student_grade.
h. The below code and table are provided to help you create a similar table of students.

 

void printReport(ofstream& outfile, salesPersonRec list[],
int listSize, double saleByQuarter[])
{
int index;
int quarter;
outfile << "––––––––––– Annual Sales Report –––––––––"
<< "––––" << endl;
outfile << endl;
outfile << " ID QT1 QT2 QT3 "
<< "QT4 Total" << endl;
outfile << "_____________________________________________"
<< "_________________" << endl;
for (index = 0; index < listSize; index++)
{
outfile << list[index].ID << " ";
for (quarter = 0; quarter < 4; quarter++)
outfile << setw(10)
<< list[index].saleByQuarter[quarter];
outfile << setw(10) << list[index].totalSale << endl;
}
outfile << "Total ";
for (quarter = 0; quarter < 4; quarter++)
outfile << setw(10)<< saleByQuarter[quarter];
outfile << endl << endl;
} //end printReport

 

 

Annual Sales Report
ID
QT1
QT2
отз
QT 4
Total
322.00
12345
32214
23422
57373
35864
1892.00
0.00
892.00
1901.00
892.00
1221.00
0.00
4906.00
494.00
2708.00
0.00
0.00
0.00
1223.00
3420.00
4965.00
343.00
1395.00
893.00
9023.00
0.00
8834.00
0.00
392.00
10258.00
3296.00
10619.00
2882.00
5326.00
54654
893.00
4705.00
Total
8298.00
18743.00
Transcribed Image Text:Annual Sales Report ID QT1 QT2 отз QT 4 Total 322.00 12345 32214 23422 57373 35864 1892.00 0.00 892.00 1901.00 892.00 1221.00 0.00 4906.00 494.00 2708.00 0.00 0.00 0.00 1223.00 3420.00 4965.00 343.00 1395.00 893.00 9023.00 0.00 8834.00 0.00 392.00 10258.00 3296.00 10619.00 2882.00 5326.00 54654 893.00 4705.00 Total 8298.00 18743.00
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

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