鶹Լ

Representing selection in a flowchart

A uses a diagram to explain the steps of an .

Consider this simple six-step algorithm for comparing your dog’s age with your own:

  • ask how old the dog is in human years
  • multiply human years by seven to find out how old the dog is in dog years
  • print answer on the screen
  • ask how old you are
  • if the dog’s age in dog years is older than your age, say ‘Your dog is older than you!’
  • otherwise, say ‘Your dog is not older than you.’

In a flowchart, this sequence would look like this:

A flowchart comparing your age with your dog’s age will first ask for your dog’s age and then your age. Based on the calculation that 1 dog year equals 7 human years it will calculate who is older.