Sie sind auf Seite 1von 6

Flowchart Practice Decisions

Scenario 1:
Read two numbers as Input, multiply them together and Output the result if it is positive
(greater than 0).
START

Input two
numbers

Multiply the two number

Is the
YES Output the
result
result
positive?

NO

END
Scenario 2:
Read 3 numbers as INPUT
Add the first 2 numbers
Multiply the result by the third number
OUTPUT the final result if it is greater than 100
Otherwise output the first number

START

Input 3 numbers

Add the first 2 numbers

Multiply the result by the


third number

Is the final
result greater
than 100?

NO YES

Display the first Display the


number read final result

END
Scenario 3:
Read two numbers as INPUT and OUTPUT the smaller (lesser) of the two
START

Input two
numbers

Compare the two numbers

Set the smaller number to A

Display A

END
Scenario 4:
Read two numbers as INPUT and OUTPUT the greater of the two

START

Input two
numbers

Compare the two numbers

Set the bigger number to A

Display A

END
Scenario 5:
Read three numbers as INPUT A, B, and C and OUTPUT the greatest of the three

START

Input Number
A, B, and C

NO Is B > C? NO Is A > B? YES Is A > C? YES


Display C Display A

YES NO

Display B Display C

END
Scenario 6:

A program that will check the age of a person and display the following messages:
a. If age < 18 Output message: “Junior Ticket”
b. If age > 60 Output message: “Senior Ticket”
c. Else Output message: “Regular Ticket”

START

Input user’s Age

NO User’s NO User’s Age < 18? YES


Display “Junior Ticket”
Age > 60?

YES

Display “Senior Ticket”

Display “Regular Ticket”

END

Das könnte Ihnen auch gefallen