(Solved) : Change Void Function Non Void Parameters Include Include Include Using Namespace Std Void Q37206020 . . .
*HOW DO I CHANGE THIS FROM A VOID FUNCTION TO A NON-VOIDWITH PARAMETERS?*
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
void studentStats() {
ifstream inputFile;
inputFile.open(“outFile.txt”);
string studentData;
string studentID;
string ID, exam1, exam2, exam3;
string header;
cout << “Enter a Student ID: “;
cin >> studentID;
bool found =false;
while (inputFile) {
inputFile >> ID;
inputFile >> exam1;
inputFile >> exam2;
inputFile >> exam3;
if (ID.compare(studentID)==0) {
cout << ID << ” ” << exam1 << ” ” <<exam2 << ” ” << exam3 << endl;
cout << “FOUND!” << endl;
found=true;
break;
}
}
if(!found) {
cout<<studentID << ” NOT FOUND!” <<endl;
}
inputFile.close();
}//ends studentStats() function
int main() {
studentStats();
}
Expert Answer
Answer to *HOW DO I CHANGE THIS FROM A VOID FUNCTION TO A NON-VOID WITH PARAMETERS?* #include #include #include using namespace st…
OR