C++ Program Bug? : <pre><code>#include &lt;iostream&gt;
#include &lt;cmath&gt;
#include &lt;string&gt;
using namespace std;
string fullName, honorsRank, className;
int year;
int testScore1, testScore2, testScore3, testScore4, testScore5;
int avgScore;
int main()
{
// Retrieve students name
cout &lt;&lt; "Please enter your full name: " &lt;&lt; endl;
cin &gt;&gt; fullName;

// Retrieve students year of high school
cout &lt;&lt; "Please indicate which year of High School you are currently     in: " &lt;&lt; endl;;
cin &gt;&gt; year;

// As for all five test scores
cout &lt;&lt; "Please enter your score for your first exam: " &lt;&lt; endl;
cin &gt;&gt; testScore1;

cout &lt;&lt; "Please enter your score for your second exam: " &lt;&lt; endl;
cin &gt;&gt; testScore2;

cout &lt;&lt; "Please enter your score for your third exam: " &lt;&lt; endl;
cin &gt;&gt; testScore3;

cout &lt;&lt; "Please enter your score for your fourth exam: " &lt;&lt; endl;
cin &gt;&gt; testScore4;

cout &lt;&lt; "Please enter your score for your fifth exam: " &lt;&lt; endl;
cin &gt;&gt; testScore5;


//Compute the average score of the five tests
avgScore = (testScore1 + testScore2 + testScore3 + testScore4 + testScore5)/5;

// Assign either freshman, sophomore, junior, or senior to the numbered year of high school
if (year == 1)
className = "Freshman";
else if (year == 2)
className = "Sophomore";
else if (year == 3)
className = "Junior";
else if (year == 4)
className = "Senior";

cout &lt;&lt; "Name........ " &lt;&lt; fullName &lt;&lt; endl;
cout &lt;&lt; "Year........ " &lt;&lt; className &lt;&lt; endl;
cout &lt;&lt; "Scores...... " &lt;&lt; testScore1 &lt;&lt; " " &lt;&lt; testScore2 &lt;&lt; " " &lt;&lt; testScore3 &lt;&lt; " " &lt;&lt;testScore4 &lt;&lt; " " &lt;&lt; testScore5 &lt;&lt; endl;
cout &lt;&lt; "Average..... " &lt;&lt; avgScore &lt;&lt; endl;


// Determine students academic standing
if (avgScore &gt;= 97.0 &amp;&amp; year == 4) {
honorsRank = "**High Honors**", cout &lt;&lt; honorsRank &lt;&lt; " Note: This student IS ELIGIBLE for graduation" &lt;&lt; endl;
}
else if (avgScore &gt;= 95.0 &amp;&amp; year == 4) {
honorsRank = "**Honors**", cout &lt;&lt; honorsRank &lt;&lt; " Note: This student IS ELIGIBLE for graduation" &lt;&lt; endl;
}
else if (avgScore &gt;= 90.0 &amp;&amp; year == 4) {
honorsRank = "**Honorable Mention**", cout &lt;&lt; honorsRank &lt;&lt; " Note: This student IS ELIGIBLE for graduation" &lt;&lt; endl;
}
else if (avgScore &gt; 65 &amp;&amp; year == 4) {
    cout &lt;&lt; "Note: This student IS ELIGIBLE for graduation" &lt;&lt; endl;
}
else if (avgScore &lt; 65.0 &amp;&amp; year == 4) {
    cout &lt;&lt; "Note: This student is NOT ELIGIBLE for graduation" &lt;&lt; endl;
}
else if (avgScore &gt;= 97.0 &amp;&amp; year &lt; 4) {
    honorsRank = "**High Honors**", cout &lt;&lt; honorsRank &lt;&lt; " Great work!! Keep it up!!" &lt;&lt; endl;
}
else if (avgScore &gt;= 95.0 &amp;&amp; year &lt; 4) {
    honorsRank = "**Honors**", cout &lt;&lt; honorsRank &lt;&lt; " Great effort!!" &lt;&lt; endl;
}
else if (avgScore &gt;= 90.0 &amp;&amp; year &lt; 4) {
    honorsRank = "**Honorable Mention**", cout &lt;&lt; honorsRank &lt;&lt; " Nice job!" &lt;&lt; endl;
}
else if (avgScore &lt; 65.0 &amp;&amp; year &lt; 4) {
    cout &lt;&lt; "Note: This student has been placed on academic probation" &lt;&lt; endl;
}

return 0;
}
</code></pre>

<p>So I know that the program runs as I intended it to (<a href="https://imgur.com/a/YIqa0" rel="nofollow noreferrer">https://imgur.com/a/YIqa0</a>) but when I type in a full name for someone with 2 words, it completely messes up the program (<a href="https://imgur.com/a/fy62N" rel="nofollow noreferrer">https://imgur.com/a/fy62N</a>).</p>

<p>For some reason entering a first and last name messes up the program and causes all of the cout statements to display and it won't let you enter anything in the text fields.</p>

<p>Any advice/tips?</p>

<p>Also I'm more of a beginner C++ programmer if you couldn't tell, so please don't get too annoyed by any idiotic mistakes if you see any :))</p>
