SQL>
SQL> set serveroutput on
SQL> set echo on
SQL>
SQL> DECLARE
2 v_Score Number := 85; --Percentage
3 v_LetterGrade Char(1);
4 BEGIN
5 IF v_Score >= 90 THEN
6 v_LetterGrade := 'A';
7 ELSIF v_Score >= 80 THEN
8 v_LetterGrade := 'B';
9 ELSIF v_Score >= 70 THEN
10 v_LetterGrade := 'C';
11 ELSIF v_Score >= 60 THEN
12 v_LetterGrade := 'D';
13 ELSE
14 v_LetterGrade := 'E';
15 END IF;
16 DBMS_OUTPUT.PUT_LINE('Your Letter Grade is: ' || v_LetterGrade);
17 END;
18 /
Your Letter Grade is: B
PL/SQL procedure successfully completed.
SQL>
SQL>
|