c++/ cpp question 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.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

c++/ cpp question

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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY