Sorry, I dont know how to ask this better, I'm a really novice programmer and I'm not looking for you to do my homework, but I want to understand why this keeps happening.
int inputScores(string names [], double scores [])
{
int count = 0; // counter variable for number of student records in array
char again; // To check if user has more data
do
{
cout << "Enter student's name: ";
getline(cin, names[count]);
cout << "\nEnter student's score: ";
cin >> scores[count];
count++;
cout << "\nDo you have more student records to enter?(Y/N): ";
cin >> again;
}while(again == 'y' || again == 'Y');
when I run this code and call the function this keeps happening and I dont know how to fix it:
Enter student's name: Arthur
Enter student's score: 100
Do you have more student records to enter?(Y/N): y
Enter student's name:
Enter student's score:
it skips the "enter student's name question" (doesnt let me type anything) and goes straight to the next question.