Setw/Nestif issues- Beginner program

SLOVED <3
Last edited on
Please edit your post to add code tags, don't forget to add the code tags around your "formatted" text.
.
Last edited on
Where have you assigned values for your variables A, B, C, and F?

Perhaps you really want something like:
1
2
3
4
5
6
7
8
if (CourseAvg >= 90)
   LetterGrade = 'A';
else if (CourseAvg >= 80) 
   LetterGrade = 'B';
else if (CourseAvg >= 70) 
   LetterGrade = 'C';
else 
   LetterGrade = 'F';


Also note that the setfil() function is "sticky", meaning it will remain at the setting until you change it again. But remember setw() is not, you must call this function every time you want o use it.
Last edited on
.
Last edited on
Please post the smallest possible complete program that illustrates your problem. But your setw() of 5 seems a little small, especially for your names. But you have a number with 5 characters "82.80" so when your "string" is equal to or larger than your setw() will not seem to be used. Remember setw() doesn't add characters to your "string" unless it is larger than the "string".

Topic archived. No new replies allowed.