Consider that the file student.txt contains the name and
corresponding exam scores of 20 students in a class (the data is
given right). Write a C++ program to perform the following tasks:
(a) read data from the file into suitable arrays
(b) output the mean of the each exam
(c) output the name and the exam scores of the student
having the best average (according to 30%, 30%, 40%).
#include<iostream>
#include<conio.h>
#include<string>
#include<fstream>
using namespace std;
int main () {
ifstream dosya("stu.txt");
string name[20];
int exam1;
int exam2;
int exam3;
int total;
for(int i=0;i<20;i++) {
dosya>>name[i]>>exam1[i]>>exam2[i]>>exam3[i];
cout<<name[i]<<" "<<exam1[i]<<exam2[i]<<exam3[i]<<endl;
}
dosya.close();
I wrote this code but it s not running and not enough for this question I am trying to write code but I havent done yet and this my quiz question for tomorrow please Could somebody help me? Please...