0% found this document useful (0 votes)
19 views2 pages

ALGORITHM Is A Step by Step P

The document outlines an algorithm for a Java program that assigns grades based on a student's percentage using an if-else if ladder. It details the steps required to implement the program, including class and method definitions, variable declarations, and the logic for grade assignment based on specified percentage ranges. The process concludes with displaying the student's name, percentage, and assigned grade.

Uploaded by

juststyle999
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

ALGORITHM Is A Step by Step P

The document outlines an algorithm for a Java program that assigns grades based on a student's percentage using an if-else if ladder. It details the steps required to implement the program, including class and method definitions, variable declarations, and the logic for grade assignment based on specified percentage ranges. The process concludes with displaying the student's name, percentage, and assigned grade.

Uploaded by

juststyle999
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

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

You might also like