# Lab #6 Program Design.

## Presentation on theme: "Lab #6 Program Design."— Presentation transcript:

Lab #6 Program Design

Symbols Decision Terminal Input/Output Operation Connector Module
Process Module

Exercise #1 We want to create a flowchart that prints out double the number of the inputted value. On the next slide is a flowchart with some blacked out boxes. On the following slide is a number of potential boxes you could use to correctly implement the algorithm. Copy and paste the boxes into the flowchart.

START END

Copy and paste them into the previous slide.
Pick the appropriate three of the following boxes that describe the algorithm as described. Copy and paste them into the previous slide. Read in A B = A*2 Print A Read in B B = A / 2 Print B Read in C B = A + 2 Print C

Exercise #2 We want to create a flowchart that reads in a number, and checks if it is odd or even. On the next slide is a flowchart with some blacked out boxes. On the following slide is a number of potential boxes you could use to correctly implement the algorithm. Copy and paste the boxes into the flowchart.

START END No Read in A Yes

Does A/2 give a remainder?
Pick the appropriate three of the following boxes that describe the algorithm as described. Copy and paste them into the previous slide. Is A > B? Read B Print “It’s Even” Does A/2 give a remainder? Print “It’s Odd” Print A /2 Is A = = B? Read C Print “I dunno”

Exercise #3 We want to create a flowchart that prints out the biggest of three inputted numbers. On the next slide is a flowchart with some blacked out boxes. On the following slide is a number of potential boxes you could use to correctly implement the algorithm. Copy and paste the boxes into the flowchart.

START END A>B? No Read in A, B and C Yes

Copy and paste them into the previous slide.
Pick the appropriate three of the following boxes that describe the algorithm as described. Copy and paste them into the previous slide. B<C? B>C? Print A A<C? A>C? Print B A<B? A>B? Print C

Exercise #4 We want to create a flowchart that prints out the word “Honour” is the number input is 70, if the number is less than 40 print out the word “Fail”, otherwise print out the word “Pass”. On the next slide is a flowchart with some blacked out boxes. On the following slide is a number of potential boxes you could use to correctly implement the algorithm. Copy and paste the boxes into the flowchart.

START END No Read in A Yes

Copy and paste them into the previous slide.
Pick the appropriate three of the following boxes that describe the algorithm as described. Copy and paste them into the previous slide. A < 70? A > 70? Print “Honour” A < 40? A > 40? Print “Fail” A > Pass? A > Honour? Print “Pass”

Exercise #5 We want to create a flowchart that prints out the average value of five numbers input in. On the next slide is a flowchart with some blacked out boxes. On the following slide is a number of potential boxes you could use to correctly implement the algorithm. Copy and paste the boxes into the flowchart.

START END No A = 1 Yes Total = 0 A = A + 1

Copy and paste them into the previous slide.
Pick the appropriate three of the following boxes that describe the algorithm as described. Copy and paste them into the previous slide. Is A==6? Is A==5? Is A==0? Print Total Print Total / 5 Print Total++ Total = X Total = Total Total = Total + X Read in A Read in Total Read in X

Exercise #6 We want to create a flowchart that allows a user to input a number and the program checks if that number is an element in an array, if it is we print “Found”, if not we print “Not Found”. On the next slide is a flowchart with some blacked out boxes. On the following slide is a number of potential boxes you could use to correctly implement the algorithm. Copy and paste the boxes into the flowchart.

START END No Read in A Yes

Copy and paste them into the previous slide.
Pick the appropriate three of the following boxes that describe the algorithm as described. Copy and paste them into the previous slide. Current = First Item Current = Next Item Current = Last Item Current == A? Current == Middle? Current == EndofList? Print “Maybe Found” Print “Not Found” Print “Found”