Grade/Class based on given Percentage.

00:41 0 Comments A+ a-

Write a PLSQL block to display Grade/Class based on given percentage.


 Program:



declare
per float;
begin
per:='&per';
if per<=100 and per>=90 then
dbms_output.put_line(per||' is merit');
elsif per>=75 and per<90 then
dbms_output.put_line(per||' is distirct');
elsif per>=60 and per<75 then
dbms_output.put_line(per||' is  A grade');
elsif per>=50 and per<60 then
dbms_output.put_line(per||' is  B grade');
elsif per>=40 and per<50 then
dbms_output.put_line(per||' is  C grade');
else
dbms_output.put_line(per||' is  Fail');
end if;
end;
/

OutPut:

Enter value for per: 98
old   4: per:='&per';
new   4: per:='98';

98 is merit