1 / 16

Session 5

Session 5. Teaching Computing to GCSE Level with Python Pseudocode & Flowcharts. In this session:. Theory (linked to programming so overlap!) Pseudocode & Flowcharts Types of errors Example examination question. Specification – Programming languages. AQA Data types

hunter
Download Presentation

Session 5

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. Session 5 Teaching Computing to GCSE Level with Python Pseudocode & Flowcharts

  2. In this session: Theory (linked to programming so overlap!) • Pseudocode & Flowcharts • Types of errors • Example examination question

  3. Specification – Programming languages AQA Data types Data structures (1 and 2 dimensional arrays) Flowcharts Structure diagrams Procedures Functions Parameters Syntax, run-time and logical errors OCR Pseudocode Flowcharts Selection and iteration Data types 1-dimensional arrays Generations of languages Assembly language/machine code Compilers and interpreters Syntax, run-time and logical errors This is a summary of headings – text available as handout

  4. Task 1: debugging a program Handout: average function in Python Can you find the errors?

  5. Program with errors There are 8 errors!

  6. Answers!

  7. Pseudocode • Many exam questions involve working with pseudocode– for example, working through an algorithm written in pseudocode • Being able to translate from pseudocode to a real language and back is a key skill • AQA have guidelines for the specification of pseudocode • http://filestore.aqa.org.uk/subjects/AQA-GCSE-COMPSCI-W-TRB-PSEU.PDF

  8. Task 2 Convert the average program to pseudocode Answer (following AQA handout): output “How many numbers do you want to average”) howManyNums UserInput runningTotal0 FOR count 1 to HowManyNums Output “Enter the next number” nextNumberUserInput runningTotalrunningTotal + nextNumber endFOR AveragerunningTotal/howManyNums output “The average of these” output HowManyNums output “is “ output Average

  9. Task 3: AQA Question(convert to pseudocode)

  10. Task 3 Answer

  11. Flowcharts Symbols for • A process (e.g. calculation) • Input or output (e.g. user input) • Terminator (start/finish) • Decision (condition of if statement or loop)

  12. Task 4 Convert average program to a flowchart

  13. Task 4: Answer (one of many possible?!) Start Input howManyNums Set count,runningTotal to 0 Is count =howmanyNums YES NO Input nextNum Add nextNum to runningTotal Increment count Calculate average Finish

  14. Task 5: convert to flowchart

  15. Task 5 Answer

  16. Summary Summary • Pseudocode and flowcharts enable us to represent/explain/design a program in a language-independent way • They allow students to focus on the logic and the program control • Students will need lots of practice with these – so start early!

More Related