0% found this document useful (0 votes)
783 views

Algorithms Homework 1 Flowcharts and Pseudocode

This document contains instructions for two algorithm design homework problems. The first asks the student to draw a flowchart for a password validation program. The second asks the student to complete a partial flowchart for a program that calculates the average of a set of student marks entered by the user using steps from a provided list. The document provides details of both problems and the partial flowchart to be completed.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
783 views

Algorithms Homework 1 Flowcharts and Pseudocode

This document contains instructions for two algorithm design homework problems. The first asks the student to draw a flowchart for a password validation program. The second asks the student to complete a partial flowchart for a program that calculates the average of a set of student marks entered by the user using steps from a provided list. The document provides details of both problems and the partial flowchart to be completed.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Homework 1

Unit 7 Algorithm design and programming

Homework 1
1. Draw a flowchart for a program which asks the user to enter a password. If the user enters
“HiThere!” then print “Welcome”, and continue (indicate continuation with a dotted line).
If they enter a different password, print “Wrong password” and end the program. [4]

2. An algorithm is to be written which calculates the average of a set of student marks entered
at a keyboard. The flowchart on the next page describes the steps in the algorithm.
However, most of the stages have been omitted.
Complete the flowchart, using item number only, from the list of items given.

Item number Item description


1 Is mark = -1?
2 Prompt for next mark
3 Output “No marks entered”
4 Input mark
5 Add 1 to count
6 Output average
7 total = 0
8 Is count = 0?
9 Add mark to total
10 average = total/count

1
Homework 1
Unit 7 Algorithm design and programming

Start

count = 0

Prompt for
first mark

Input
mark

Yes Yes

No No

End

[6]

[Total 10 marks]

You might also like