User defined procedures and functions presentation 2 variant

  • pptx
  • 02.05.2020
Публикация на сайте для учителей

Публикация педагогических разработок

Бесплатное участие. Свидетельство автора сразу.
Мгновенные 10 документов в портфолио.

Иконка файла материала User defined procedures and functions presentation 2 variant.pptx

User defined procedures and functions

Algorithmization and Programming

LEARNING OBJECTIVES

write a code in the programming language using functions and procedures

Lesson objectives

10.4.1.1 Write code in a programming language using functions and procedures

Success criteria
Describes the function / procedure parameters
Uses function / procedure when solving problems
Creates its own function / procedure to solve practical problems

4

Task 1

Write a procedure called “Display” that will prompt the user to enter two integer numbers n and m, and will display all the numbers from n until m. i.e.
If n = 4, m = 9 it will display: 4 5 6 7 8 9
Also, write the main program to call the procedure “Display”.
Draw the flowchart of the above program.

Descriptors:
Student
correctly writes a procedure and the main program;
correctly draws the flowchart of program.

5

Task 2

Write a procedure called “Sum” that will prompt the user to enter two integer numbers n and m, and will display the sum of all the numbers from n until m. i.e.

If n = 2, m = 6 it will display: 20
since 2 + 3 + 4 + 5 + 6 = 20

Descriptors:
Student
correctly writes a procedure and the main program;
correctly draws the flowchart of program.

6

Task 3

Write a program to ask for the price of a product and display the discount. The discount which is 15% will be calculated and displayed in the procedure “Discount”, that will take the price as a value formal parameter.

Draw the flowchart of the above program.

Descriptors:
Student
correctly writes a procedure and the main program;
correctly draws the flowchart of program.

Evaluation

Individual work

Create a method that defines even and odd numbers.
Create a method that defines the area and length of the circle.

FEEDBACK

Today I learned ...
it was difficult…
I realized that ...
I learned…
I could ...
it was interesting to know that ...
I was surprised ...
I wanted…