1 / 21

Lab #6

Lab #6. Program Design. Lab #6. You are presented with six exercises where you have to fill-in-the-blanks. For each exercise you are presented with a flowchart with some blank boxes, and on the following page a number of potential answers are provided, including the correct answers.

dannon
Download Presentation

Lab #6

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab #6 Program Design

  2. Lab #6 • You are presented with six exercises where you have to fill-in-the-blanks. For each exercise you are presented with a flowchart with some blank boxes, and on the following page a number of potential answers are provided, including the correct answers. • In the Word document you have all your labs and tutorials in: PROGRAM-DESIGN-PORTFOLIO.DOC (or .DOCX) • add in the screengrabs from this. Now e-mail your document to Damian.Gordon@dit.ie with a subject heading of PROGRAM DESIGN LAB #6 and in the message of your e-mail please let me know your full name, your student number, the name of your programme, the programme code, the name of the module, the year you are in (first year), and your assignment. • PLEASE NOTE: If you do not have the correct subject heading on your e-mail, or the correct filename, your submission WILL be rejected.

  3. Symbols Decision Terminal Input/Output Operation Connector Module Process

  4. 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.

  5. START END

  6. Pick the appropriatethree of the followingboxes 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

  7. 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.

  8. START Read in A No Yes END

  9. Pick the appropriatethree of the followingboxes 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”

  10. 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.

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

  12. Pick the appropriatethree of the followingboxes 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

  13. 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.

  14. START Read in A No Yes Yes No END

  15. Pick the appropriatethree of the followingboxes 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”

  16. 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.

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

  18. Pick the appropriatethree of the followingboxes 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

  19. 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.

  20. START Read in A Yes No Yes No END

  21. Pick the appropriatethree of the followingboxes 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 == EndofList? Current == Middle? Print “Maybe Found” Print “Not Found” Print “Found”

More Related