Wednesday 1 July 2015

14. Repetition construct: while loop, flowcharts






Activity 13.1
While command
What does this while command do?
What is the condition that is being tested and how does it change?
Activity 13.2
Write a program that asks the user if they are hungry. While they reply ‘N’ the program repeats the question, showing how many times they have replied ‘N’.  
When they reply ‘Y’, the program tells them to get something to eat.
Activity 13.3
What does this program do?
What is the ‘sentry’ variable?
What is the condition?
Activity 13.4
Flowcharts and while command
Flowcharts can be used to represent programs. Complete the flow chart for this program.

No comments:

Post a Comment