|
-
Feb 19th, 2003, 03:20 PM
#1
Thread Starter
Lively Member
char array
Hello everyone. I am writing a simple function that returns a char array. Here is the code that I have so far. Can anyone help me fix the errors I am having working with the char array? Thanks.
char[] getLetterGrade(float average)
{
char[] letterGrade;
//this code checks the average passed to it and returns the proper grade
if(average>=93) letterGrade='A';
else
if(average>=87) letterGrade='AB';
else
if(average>=83) letterGrade='B';
else
if(average>=77) letterGrade='CB';
else
if(average>=73) letterGrade='C';
else
if(average>=67) letterGrade='CD';
else
if(average>=60) letterGrade='D';
else
if(average<60) letterGrade='F';
return letterGrade;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|