Hello All!
I am in week three of my C++ class and it still isn't coming easy!
I'm quite sure it never will!! This week I am writing a function to compute grades from numeric to alpha. I am getting an error and I have read everything I can get my hands on and still have no idea. I'm sure just one look from any of you will figure out what I have struggled with for days. (yes days - sick and wrong isn't it!)
Below is the code - function and main .cpp and the header .h files.
Thank you in advance for any assistance you can give me.
mz
This is the main.
Code:#include <iostream.h> #include "Calcgrades.h" void main() //main program { float A, B, C, D, F; char ngrade, lgrade; float count = 0.0; A = 0.0; B = 0.0; C = 0.0; D = 0.0; F = 0.0; while (count < 10.0); // put at 10 for testing { Calcgrades(); } cout <<"Grades (A, B, C, D, F) : "; cout <<A<< "," <<B<< "," <<C<< "," <<D<< "," <<F<< endl; }char Calcgrades(); float count = 0.0;Code:This is the function file:This is the header file.Code:char Calcgrades(char lgrade,char ngrade); { if (ngrade >= 90) { lgrade = A; } else if (ngrade >= 80 and < 90) { lgrade = B; } else if (ngrade >= 70 and < 80) { lgrade = C; } else if (ngrade >= 60 and < 70) { lgrade = D; } else if (ngrade < 50) { lgrade = F; } cout >> "calcgrade lgrade :" >> lgrade >>; endl; //for test return lgrade; }
THANKS!!!!



LinkBack URL
About LinkBacks



: