Download Flowcharts - WordPress.com

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Large numbers wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Addition wikipedia , lookup

Elementary mathematics wikipedia , lookup

Transcript
AS-Level
FlLOW CHARTS (Assignment 2)
1) With reference to the following flowchart:
a) Answering 'YES' to every question, describe what happens
on that particular day.
b) Today is Sunday. What happens?
c) How would you change the flowchart to allow for Sundays?
2) Draw a flowchart to illustrate how to cross the road safely.
3) Look at the following flowchart.
Paper 2
a) Dry run this flowchart with data:
(i) A=5, B=13, C=2
(ii) A=13, B=2, C=5
4) Dry run this flowchart. Can you recognize a pattern in the sequence of numbers produced?
5)
Draw a flowchart to playa dice game according to the
following rules:
(i) If you throw two identical numbers, you win.
(ii) If the numbers are not the same, but are both even, or both odd, you have another turn.
(iii) If one number is odd, and the other is even, you lose.
6)
One afternoon, Peter and John decide that they will go out at six o'clock that evening on their
bicycles if it is dry. If it is raining, they will both go to Peter's house. There they will play with
Peter's model train set if Peter's father is at home to help them set it up; otherwise they will
watch television. Draw a flowchart to illustrate the above information.
7) Refer to the following flowchart.
a) Answering 'NO' whenever an empty box is encountered,
dry run the flowchart with the given data.
What do the numbers output have in common?
b) Write in Box 1 'is N exactly divisible by 3?'
Dry run again with the original data.
c) One of the numbers in (b) is not a prime number.
There are three possible questions you could ask in Box 2 in order to remove this number from the
list. Give two of them.
7)
A newspaper boy carried out a survey on the papers he delivered. He coded them as follows:
Daily Bugle - 1
Daily W ail- 2
Daily Trumpet - 3
Draw a flowchart to count the number of copies of each paper he delivered, and to print out
the results for each paper, expressed both as the number of copies and as a percentage of the
total number of papers he delivered.
8) Draw program flowcharts that show the algorithm to find:
a) the sum of the first 50 Integers;
b) factorial N (N!), where N is entered by the user.
9) Convert each of your program flowcharts from 8(a & b), into pseudo-code.
(Last date of submission: 30 July)