Skip to content

Grade by score

PHP if / elseif / else

Same task in: PythonGo

Flowchart (ISO 5807)

YesNoYesNoStartInput scorescore ≥ 90Output «Відмінно»score ≥ 60Output «Задовільно»Output «Незадовільно»EndFigure 1 — grade

Source code

PHP
function grade($score) {
    if ($score >= 90) {
        echo "Відмінно";
    } elseif ($score >= 60) {
        echo "Задовільно";
    } else {
        echo "Незадовільно";
    }
}

The editor opens with this code — change it and the chart redraws.

Language
PHP
Constructs
if / elseif / else
Topic
Branching
Formats
Word, Visio, draw.io, PDF, SVG

Related examples