Professional Documents
Culture Documents
Python Training
Python Training
Python Training
Adult RM40
If 65 year old and above RM25
Write an algorithm for this restaurant to determine the price of one customer in
the form of:
1. Pseudocode
2. flowchart
Study the below scenarios:
• Scenario 1:
Ahmad runs in a marathon. When he reaches the finishing line, if there is
nobody reaches before him, he is the winner. If at the same time, he can break
the record, not only he will take away the champion cup, he will also win a cash
reward. If he is not the first that reaches the finishing line, he will receive
certificate of participation.
• Scenario 2:
Ahmad runs in a marathon. So long as he doesn’t see the finishing line, he needs
to keep running.
Discuss among your group and decide what structural statement you
will use for the above scenarios. Explain your choice.
Let’s conclude your finding.
• Scenario 1:
We use “if…else” statement.
• Scenario 2:
We use “while”
Bunny 90 87 95
Duck 78 96 89
Rubble 83 85 92
Continue
• The continue statement is used to skip the rest of the code inside a
loop for the current iteration only.
• Loop does not terminate but continues on with the next iteration.
Break
• The break statement terminates the loop containing it. The program
jumps to the statement immediately after the body of the loop.