Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming Techniques

Similar presentations


Presentation on theme: "Programming Techniques"— Presentation transcript:

1 Programming Techniques
Keywords Parameter, Function, Procedure, Argument, Variable, Program. Programming Techniques Sub Programs

2 Why use sub programs? Objectives BEGINNER: Define a sub program in computing. ADVANCED: Explain functions, procedures, parameters and arguments. EXPERT: Develop a program that uses a function. Sub programs can be used to save time and simplify code. The main types of sub programs are procedures and functions. When you want your program to repeat in different places you only need to call the name of the sub program. This saves time and simplifies code by avoiding repetition of code. Starter activity

3 Procedure Objectives BEGINNER: Define a sub program in computing. ADVANCED: Explain functions, procedures, parameters and arguments. EXPERT: Develop a program that uses a function. Procedures are sets of instructions stored under one name (identifier). Starter activity If we call name() and input Jon it would output: Hello Jon

4 Function Objectives BEGINNER: Define a sub program in computing. ADVANCED: Explain functions, procedures, parameters and arguments. EXPERT: Develop a program that uses a function. Functions are similar to procedures but always return a value to the main program. Starter activity

5 Parameter and Arguments
Objectives BEGINNER: Define a sub program in computing. ADVANCED: Explain functions, procedures, parameters and arguments. EXPERT: Develop a program that uses a function. A Parameter is a special name given to a variable that is passed into a sub function. It is worth noting that both procedures and functions can take in parameters. An argument is the name given to the actual values when the sub program is called. Starter activity

6 Task 90-100 = A* 80-89 – A 70 – 79 – B 60 – 69 – C <60 - Fail
Objectives BEGINNER: Define a sub program in computing. ADVANCED: Explain functions, procedures, parameters and arguments. EXPERT: Develop a program that uses a function. Write a function called GradeCalculator() that converts an exam result to a grade using the following boundaries: = A* 80-89 – A 70 – 79 – B 60 – 69 – C <60 - Fail Starter activity Can you create pseudo code and then write the program in python?


Download ppt "Programming Techniques"

Similar presentations


Ads by Google