ALGORITHM: is a step by step procedure for writing a program.
Create a Java program that accepts a student's percentage as
input and assigns a grade based on the following criteria using an
if-else if ladder:
• 90-100: A+
• 80-89: A
• 70-79: B
• 60-69: C
• 50-59: D
• Below 50: Fail
STEP 1: START
STEP 2: Define a class called………….
STEP3: Define a method called ……
STEP 4: Declare an object of Scanner class called ..
STEP 5: Declare a variable of type String n ,double, to accept
the percentage of a student name ,per,
and a String variable to assign grade .
STEP 6: Input the value of percentage in name and per
STEP 7: Check if per is greater than or equal 90 and less than or
equal to 100 ,if yes go to step 8
otherwise go to step 9.
STEP 8: Assign the value A+ to the variable grade , go to step
18
STEP 9: Check if per is greater than or equal 80 and less than or
equal to 89 ,if yes go to step 10
otherwise go to step 11.
STEP 10: Assign the value A to the variable grade ,go to step 18
STEP 11: Check if per is greater than or equal 70 and less than
or equal to 79 ,if yes go to step 12
otherwise go to step 13.
STEP 12: Assign the value B to the variable grade ,go to step 18
STEP 13: Check if per is greater than or equal 60 and less than
or equal to 69 ,if yes go to step 14
otherwise go to step 15.
STEP 14: Assign the value C to the variable grade ,go to step
18
STEP 15: Check if per is greater than or equal 50 and less than
or equal to 69 ,if yes go to step 16
otherwise go to step 17.
STEP 16: Assign the value D to the variable grade ,go to step
18
STEP 17: Assign the value FAIL to the variable grade
STEP 18: Display the value of name, per and grade with
appropriate message
STEP 19: End of method
STEP 20 : End of class
STEP 21 : Stop