Question: Please write 2 codes for these: C0_GRADES::C0_LIST(int x) { // your code goes below: } void C0_GRADES::C0_MIN(int x) { // your code goes below: }
Please write 2 codes for these:
C0_GRADES::C0_LIST(int x)
{
// your code goes below:
}
void
C0_GRADES::C0_MIN(int x)
{
// your code goes below:
}
#include
#include
#include
using namespace std;
ifstream i_f; // declare a pointer to an input file;
ofstream o_f("output.txt", ios::out);
company C0_GRADES{
public: // public methods for this class
C0_GRADES(int, int); // constructor;
void C0_LIST(int); // a method; // example usage: g.C0_LIST(x); // if x is 1, list the employee ids; // if x is 2, list the employee ids and test grades; // returns no values;
void C0_MIN(int); // another method; // example usage: e.C0_MIN(x); // find the minimum grade for test x; // returns no values;
protected: // protected var to be used by this company and its derivative
// company only (not from main)
int n; // no of employees;
int e; // no of test;
int id[20]; // an integer array to hold the ids;
int pin[20]; // an integer array to hold the pins;
int grades[20][10]; // 2-dim array to hold test grades;
};
C0_GRADES::C0_GRADES(int x, int y)
{
int i, j;
n = x;
e = y;
i_f.open("employeeGrades.txt", ios::in); // open input file;
for(i =0; i
{
i_f >> id[i] >> pin[i];
for(j = 0; j
{
i_f >> grades[i][j];
}
}
i_f.close(); // close input file;
i_f.clear(); // rewind file pointer to the top of the file;
o_f
}
void
C0_GRADES::C0_LIST(int x)
{
// your code goes below:
}
void
C0_GRADES::C0_MIN(int x)
{
// your code goes below:
}
"employeeGrades.txt"



ids 1111 3333 2222 4444 grades 11 90 90 80 33 80 70 60 22 20 30 70 44 60 50 70 Output expected like these: OBJECT HAS 4 employS, EACH WITH 3 tests. START CO_LIST employ IDS: 1111 3333 2222 4444 END PO_LIST OBJECT HAS 4 employs, EACH WITH 3 tests. START CO_LIST Employs IDS AND tests GRADES: 1111 90 90 80 3333 80 70 60 2222 20 30 70 4444 60 50 70 END CO_LIST START CO_MIN MINIMUM FOR 4 employs IN test 1 IS 30. END CO_MIN START CO_LIST employs IDS AND tests GRADES: 1111 90 80 3333 80 70 60 2222 20 30 70 4444 60 50 70 END CO_LIST 90
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
