Skip to content

Grade by score

Go if / else if / else

Same task in: PythonPHP

Flowchart (ISO 5807)

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

Source code

Go
func grade(score int) string {
    if score >= 90 {
        return "Відмінно"
    } else if score >= 60 {
        return "Задовільно"
    }
    return "Незадовільно"
}

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

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

Related examples