From Problem Description to Python Program
An Illustrative Example
1. Problem Description / Requirements
Develop a flowchart that represents the behaviour of the following program:
A program needs to show the user a menu with three options.
If the user selects the first option, the program will ask the user for a number. Once the user enters
the number, the program will display the output of multiplying that number in sequence by every
number between 1 and 12 inclusive. For example, if the user enters the number 2, the program will
display 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24. The program will then display the menu again so that
the user can select another option (which may be the first option again).
If the user selects the second option, the program will ask the user for two numbers. The program
will add these numbers together and display their sum. The menu will then be displayed again so
that the user can select another option (which may be the second option again).
If the user selects the third option, the program will display the message “Goodbye” and will end.
If the user selects none of the options 1, 2, or 3 then the program will display the message “Invalid
Option”. The menu will then be displayed again so that the user can select a valid option.
2. Flowchart Design
3. Python Program
Or
Or