Hi! I am trying to write this information to a file (I am not worrying about the actual formatting right at this moment) and after I coded the outFile << [whatever code goes here], it repeated itself and seems to still output to the screen. For this lesson in particular, I wasn't able to attend the lecture, so I know I am not writing to the file correctly. Any tips or ideas on how to fix this would be amazing!
How many scores would you like to read? : 12
Enter your grade for assignment 1: 12
12
Enter your grade for assignment 0: 12
Enter your grade for assignment 1: 12
Enter your grade for assignment 2: 12
Enter your grade for assignment 3: 12
Enter your grade for assignment 4: 12
Enter your grade for assignment 5: 12
Enter your grade for assignment 6: 12
Enter your grade for assignment 7: 12
Enter your grade for assignment 8: 12
Enter your grade for assignment 9: 12
Enter your grade for assignment 10: 12
Enter your grade for assignment 11: 12
Enter your grade for assignment 12: 12
// This is what it should be:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
How many scores would you like to read? : 12
Enter your grade for assignment 1: 12
Enter your grade for assignment 2: 12
Enter your grade for assignment 3: 12
Enter your grade for assignment 4: 12
Enter your grade for assignment 5: 12
Enter your grade for assignment 6: 12
Enter your grade for assignment 7: 12
Enter your grade for assignment 8: 12
Enter your grade for assignment 9: 12
Enter your grade for assignment 10: 12
Enter your grade for assignment 11: 12
Enter your grade for assignment 12: 12
count is 0 at start
WHILE ( count < userInput && cin >> grade )
{
IF grade is valid
{
// we have got a grade
++count; // we have got count valid grades show far
outFile << grade << '\n'; // store the result
}
}