|
-
February 28th, 2010, 08:56 PM
#1
Newbie Help with Study Guide Question---NOT HOMEWORK
Hello,
The questions says a professor determines his grades based on the following table.
score
90-100
80-89
70-79
60-69
<60
grade
A
B
C
D
F
Assign the appropriate value to the variable grade(character) based on the variable score(integer). Use the switch structure.
We were told you are not supposed to use relational operators in JAVA in a switch (char or int).
My thoughts would have been
{
case 1: Grade = "A";
break;
case 2: Grade = "B";
break;
case 3: Grade = "C";
break;
case 4: Grade = "D";
break;
default:
Grade = "F";
}
I just don't know how to work in the grade scale. Any help appreciated. I am unsure if I posted this correctly.
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
|