User defined procedures and functions didactic material 2 variant

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

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

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

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

Practical work №1

 

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 name the procedure “Display”.

Draw the flowchart of the above program.

 

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

 

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.