Flowchart examples · Programming and algorithms

Flowchart to calculate a student's grade from marks

Check the mark is between 0 and 100, then test the highest grade boundary first and work down until one fits.

Use this template Describe your own version

Marks to letter grade

Marks to letter gradeYesNoYesNoYesNoYesNoYesNoStartRead marksmarks < 0 or marks >100?Print invalid marksmarks ≥ 90?grade = Amarks ≥ 80?grade = Bmarks ≥ 70?grade = Cmarks ≥ 60?grade = Dgrade = FPrint gradeEnd
Use this template →Opens this exact diagram in the editor, every box and arrow editable. Free account; no AI credits used.

A worked example to adapt. Rename steps, add branches and owners to match how your team actually works.

Edit the steps to match your process. The free preview (no sign-up) drafts up to 8 main steps; add branches and the remaining steps in the editor.
Mermaid source for this diagram
flowchart TD
  s(["Start"])
  in[/"Read marks"/]
  d0{"marks < 0 or marks > 100?"}
  bad[/"Print invalid marks"/]
  d1{"marks ≥ 90?"}
  ga["grade = A"]
  d2{"marks ≥ 80?"}
  gb["grade = B"]
  d3{"marks ≥ 70?"}
  gc["grade = C"]
  d4{"marks ≥ 60?"}
  gd["grade = D"]
  gf["grade = F"]
  out[/"Print grade"/]
  e(["End"])
  s --> in
  in --> d0
  d0 -->|Yes| bad
  d0 -->|No| d1
  d1 -->|Yes| ga
  d1 -->|No| d2
  d2 -->|Yes| gb
  d2 -->|No| d3
  d3 -->|Yes| gc
  d3 -->|No| d4
  d4 -->|Yes| gd
  d4 -->|No| gf
  ga --> out
  gb --> out
  gc --> out
  gd --> out
  gf --> out
  out --> e
  bad --> e

Paste into any Markdown tool that renders Mermaid, such as GitHub.

About this student grade flowchart

Turning a numeric mark into a letter grade is a common first exercise with if-else chains. The flowchart reads one mark, rejects anything outside 0 to 100, and then tests the grade boundaries from the top down.

Testing from the highest boundary first keeps every decision simple. By the time the chart asks marks ≥ 80?, it already knows the mark is below 90, so a Yes means exactly the B range. Testing from the bottom up, or in a random order, needs two comparisons per range and is easy to get wrong.

The boundaries here (90, 80, 70, 60) are one common scale, used as an example. Schools and courses set their own, and many add plus and minus grades. Change the numbers in the diamonds to match yours; the shape of the chart stays the same.

Step by step

  1. Input. Read the mark.
  2. Validate. If the mark is below 0 or above 100, print an error and end.
  3. Top grade. If the mark is 90 or more, the grade is A.
  4. Next boundaries. Otherwise test 80, 70 and 60 in turn. The first Yes sets the grade.
  5. Fail. If every test is No, the grade is F.
  6. Output. All grade boxes join at one output step that prints the grade.

How to make it in flow-chart.io

  1. Start from the example. Press "Use this template" to open this exact grade calculation flowchart in the editor, or edit the text in the generator box and press Generate for a free preview without signing up.
  2. Match your program. Rename the input, process and output boxes so they use the same variable names as your code. Keep one action per box.
  3. Check every branch. Trace each diamond with a test value for the Yes exit and one for the No exit, and make sure both reach the end oval.
  4. Share or export. Share a read-only view link with a classmate or reviewer. Downloads as PNG, SVG or PDF are part of Flow Pro (see pricing).

Tips

Frequently asked questions

How do I draw a flowchart to find a student's grade?
Read the marks, reject values outside 0 to 100, then use a chain of decisions from the highest boundary down: 90 or more is A, 80 or more is B, 70 or more is C, 60 or more is D, otherwise F. Join every grade at one print step.
Why test the highest grade first?
Each No rules out every higher grade, so the next question only needs one comparison. It also makes the chart match an if-else if chain in code.
What if my school uses different grade boundaries?
Change the numbers in the decision diamonds. You can also add more diamonds for extra grades such as A+ or E.
Should the invalid check come first?
Yes. Without it, a mark of 150 would print A and a mark of -5 would print F, which hides typing mistakes.
Can I edit this grade flowchart?
Yes. Press Use this template to open it in the editor with a free account, or describe your own grading rules in the generator box.

Related

Flowchart to find the largest of three numbersFlowchart to check even or odd numberLeap year flowchartDecision tree templateFlowchart symbolsHow to make a flowchartText to flowchart toolAll flowchart examples

Build it from your own words

Describe your process and get an editable diagram. Free to build and edit; Flow Pro adds downloads and unlimited projects.

Start free See pricing