Question
C++ 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.
C++
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.
Student1 6 3 5 9 4 2 8 6 5 8 Student2 9 9 7 8 7 9 8 6 8 9 Student3 2 3 5 1 6 4 2 3 6 5
Screenshot
Code
#include
using namespace std;
struct SG { float arraySG[10]; string name; char LG; }; class Grade { public: SG Data[10]; int i, j, total,count; Grade() { i=0; j=0; total = 0; count=0; readFromFile(); } void readFromFile() { char line[20]; //considering max size of any line in file is 20 character. change if required. FILE *fileRead = fopen("scores.txt", "r"); //r means opening file in read mode if(fileRead == NULL) //NULL means either file does not exists or there is no permission to open file { cout= 10, I have given P. Please change it }
//show details on screen for(i=0; i
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