Hello, my code works fine the first run-through but when you repeat it, it skips over two user inputs. Can someone show me what I am missing?
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
float averagescore = 0.0;
string students_name;
int exams=0, exam_score=0, totalscore=0;
//prompts user for input of name and number of exams taken by student
void getStudentName()
{
cout << "Please enter the student's name: ";
getline(cin, students_name);
}
void getNumberExams()
{
cout<<"Please enter the number of exams taken by the student in the course:"<<endl;
cin>>exams;
cout<<"Enter the exam scores:"<<endl;
while (exams < 1)
{
cout<<"Invalid: Please Try Again"<<endl;
cin >> exams;
}
}