Hello,
I have a program I am working on that is working, except for the output for the avg. I know NaN can occur when the denominator is a zero, but mine are not zeros. Here is the relevant code.
double avg6 = (grade6tot/cont6Count); // grade_tot's are declared as double,
double avg7 = (grade7tot/cont7Count); // cont_count's are declared as int.
double avg8 = (grade8tot/cont8Count);
Console.WriteLine("Grade Level # of Contribs Total Amount Average");
Console.WriteLine("6th Grade {0} {1,7:c} {2,5:c} ", cont6Count, grade6tot, avg6);
Console.WriteLine("7th Grade {0} {1,7:c} {2,5:c} ", cont7Count, grade7tot, avg7);
Console.WriteLine("8th Grade {0} {1,7:c} {2,5:c} ", cont8Count, grade8tot, avg8);
Thanks a bunch.