import java.io.*;
class Ex4
{
public static void main(String[] args)
{
Console console=System.console();
String input;
System.out.println("Please enter the number");
input=console.readLine();
int number;
number=Integer.parseInt(input);
int sum;
sum=((number/10)*10);
switch(sum)
{
case 60:
System.out.println("E");
break;
case 70:
System.out.println("D");
break;
case 80:
System.out.println("C");
break;
case 90:
System.out.println("B");
break;
case 100:
System.out.println("A");
number=100;
break;
default:
System.out.println("F");
break;
}
}
}
the instruction to this code is to make the user write numbers from 1-100 and the application should categorize the numbers in the following way
100 - A
90-99 - B
80-89 - C
70-79 - D
60-69 - E
other - F
the problem is with the other. it should go from 59 to 0.
however, the application categorizes any number as "others"
how can i cause the application to accept numbers from 0-100 and not accept numbers higher than 100?