Question: #include #include using namespace std; ifstream inFile(values.txt); void read_marks(string *B00, int *c1, int *c2, int *c3, int n) { // opening the file with object
#include #include using namespace std;
ifstream inFile("values.txt");
void read_marks(string *B00, int *c1, int *c2, int *c3, int n) { // opening the file with object inFile for(int i=0; i // Reading the file inFile >> B00[i] >> c1[i] >> c2[i] >> c3[i]; cout
void compute_gpa(string *B00, int *c1, int *c2, int *c3, float *gpa, int n) { // variable to store average marks float avg_marks; for(int i=0; i // calculating average marks avg_marks = (c1[i] + c2[i] + c3[i]) / 3; // calculating gpa if(avg_marks >= 90 && avg_marks = 85 && avg_marks = 80 && avg_marks = 77 && avg_marks = 73 && avg_marks = 70 && avg_marks = 65 && avg_marks = 60 && avg_marks = 55 && avg_marks = 50 && avg_marks
void write_marks(string *B00, int *c1, int *c2, int *c3, float *gpa, int n) { // opening or creating the file with object outFile ofstream outFile("output.txt"); outFile
int main() { // Reading Number of Students int n; inFile >> n;
// Declaring arrays string B00[n]; int c1[n], c2[n], c3[n]; float gpa[n];
// Calling Functions read_marks(B00, c1, c2, c3, n); compute_gpa(B00, c1, c2, c3, gpa, n); write_marks(B00, c1, c2, c3, gpa, n); }
The Input file looks like this:

The output file looks like this:

Question:
![object inFile for(int i=0; i // Reading the file inFile >> B00[i]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3a10d65328_50966f3a10d09d9e.jpg)
10 B00999999 89 78 58 B00999998 72 45 86 B00999997 93 75 54 B00999996 63 74 73 B00999995 83 57 52 B00999994 74 85 76 B00999993 42 75 50 B00999992 74 59 65 B00999991 95 80 78 B00999990 94 90 98 number of students: 10 B00999999 89 78 58 3 B00999998 72 45 86 2.3 B00999997 93 75 54 3 B00999996 63 74 73 2.7 B00999995 83 57 52 2 B00999994 74 85 76 3.3 B00999993 42 75 50 1.7 B00999992 74 59 65 2.3 B00999991 95 80 78 3.7 B00999990 94 90 98 4.3 Modify the previous program so that the arrays are dynamically allocated within the functions read_values() and compute-gpa(). The program input/output remains unchanged
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
