mardi 31 octobre 2017

PL/SQL Will this if then statement work?

If p_CreditHour is between 0 and 30 (including), the system prints "This student is a Freshmen" on the screen; if between 31 and 60 credits, print "This student is a Sophomore", between 61-90 credits, print "This student is a Junior"; for more than 91 credits, print "This student is a Senior."

Does the following program reflect the logic of the previous problem?

IF credit <= 30 THEN
     dbms_output.putline ('This student is a Freshmen'.);
END IF;
IF credit <= 60 THEN
     dbms_output.putline ('This student is a
Sophomore.');
END IF;
IF credit <= 90 THEN
     dbms_output.putline ('This student is a Junior.');
END IF;
IF credit > 90 THEN
     dbms_output.putline ('This student is a Senior.');
END IF;

Aucun commentaire:

Enregistrer un commentaire