Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please change my code from a struct to a class. thank you. code with c++ showing the output as well with screen shots of your

please change my code from a struct to a class. thank you. code with c++ showing the output as well with screen shots of your code. image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
LAB #3 - MODIFICATIONS to LAB #2 Create a CLASS that has all the functionality of the PREVIOUS LAB. i.e., USE YOUR USER-DEFINED FUNCTIONS as the FUNCTION MEMBERS OF YOUR CLASS. WRITE A PROGRAM THAT USES ALL THE FUNCTIONALITY of THE CLASS and OUTPUTS the RESULTS. Styles Paragraph //CODE WITH COMMENTS: #include #include #include using namespace std: l/struct struct SG float arraySG[10] string name; char LG I/function prototypes void readFile(fstream& file, SGI); void calculateAverage Grade(SG[], int); int find Highest Grade(float(1); int findLowestGrade(float(1); int main() Ilallmydeclarations SG students[10]://10 different strucks for ten different students) int Highest Test: float HighestGrade: int Lowest Test, float LowestGrade: fstream grades; grades.open("grades 1.txt"); readEile(grades, students); //read file calculate Average Grade(students, 10); //calculate average l/print result for (int i = 0; i> name) studentList[index].name = name; for (int i = 0; i> studentList[index] arraySGO: index++ Il calculate average and assignsletter grade void calculate Average Grade(SG studentListint listSize) I/finds sum of each students 10 grades for (int i = 0; i = 95) studentListLG = 'A'; else if (avg >= 85) studentList[O.LG = 'B', else if (avg >= 85) studentListLG = 'C', else if (avg >= 85) studentListLG = 'D': else studentListLG="F: ifinds highest grade intfindlichestGrade(float and int Hugbindex=0 for (int i=1;i arri) Lowlndex = i return Lowlndex TEXT FILE: Jeff Jones 50 60 55 90 35 65 52 70 69 65 AnneAimes 28 13 20 33 73 45 53 56 65 45 Steve Smith 98 99 97 87 89 75 78 87 76 75 HelenHuber 72 75 67 86 65 67 89 90 ArthurAdams 65 72 83 86 87 88 93 94 Zeke Zook 25 20 19 13 10 11 32 43 20 22 George Gomez 56 64 76 65 63 78 70 71 73 69 Tom Tate 89 98 99 97 99 98 99 94 DonnaDoyle 81 82 80 85 83 84 87 86 84 98 EdError 87 88 0 81 @ @ 78 79 75

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions