Comp Science 2
Comp Science 2
Unit 6 Algorithms
1. Draw a flowchart for a program which asks the user to enter a password. If the user enters
“HiThere!” then print “Welcome”, and then end the program.
If they enter a different password, print “Wrong password” and end the program. [4]
Start
input password
if password N if password
Print “welcome”
Print “wrong
Password”
end
(a) Complete the flowchart, using the item number from the list of
items given below. [6]
2
Homework 4 Flowcharts
Unit 6 Algorithms
(b) State the three types of basic programming constructs that have been used in the
algorithm. [3]
Count =
Coiunt +1
entered
Entered
Input “enter
Mark again
3
Homework 4 Flowcharts
Unit 6 Algorithms
4
Homework 4 Flowcharts
Unit 6 Algorithms
(c) How many examples of iteration are there in the algorithm? [1]
(d) How many decision symbols are used in the algorithm? [1]
2
[Total 15 marks]