#include <string>
#include <iostream>
#include <cmath>
using namespace std;
const int findMe (string n[MAXIMUM = 100], double scor[MAXIMUM = 100],)
{
}
int main ()
{
string names[MAXIMUM];
double score[MAXIMUM];
for (int x = 0; x < MAXIMUM; x++)
{
cout << "Please enter a student name (Enter a blank to stop): ";
getline(cin, names[x]);
cout << "Please enter this student's score: ";
cin >> score[x];
cin.ignore();
}
cout << endl << "*****************" << endl;
while (true)
{
string lookmeup;
double tmpscore;
cout << "Enter a name to look up: ";
getline(cin, lookmeup);
if (findMe(lookmeup, names, score, tmpscore))
cout << lookmeup << " has a score of " << tmpscore << endl;
else
cout << lookmeup << " was not found." << endl;
}
}
I am trying to get output like this:
Please enter a student name (Enter a blank to stop): Adam
Please enter this student's score: 11.11
Please enter a student name (Enter a blank to stop): Betty
Please enter this student's score: 22.22
Please enter a student name (Enter a blank to stop): Charlie
Please enter this student's score: 33.33
Please enter a student name (Enter a blank to stop): Debbie
Please enter this student's score: 44.44
Please enter a student name (Enter a blank to stop): Elaine
Please enter this student's score: 55.55
Please enter a student name (Enter a blank to stop):
*****************
Enter a name to look up: Adam
Adam has a score of 11.11
Enter a name to look up: Elaine
Elaine has a score of 55.55
Enter a name to look up: Bob
Bob was not found.
Enter a name to look up: Charlie
Charlie has a score of 33.33
Enter a name to look up:
I dont know how to go about my function and am not sure how I can stop the loop with just a blank space. Also just wanted to see if my main is mostly correct.
Thanks for a any help