Presentation is loading. Please wait.

Presentation is loading. Please wait.

 Experiment 07 Function Dr. rer.nat. Jing LU

Similar presentations


Presentation on theme: " Experiment 07 Function Dr. rer.nat. Jing LU"— Presentation transcript:

1  Experiment 07 Function Dr. rer.nat. Jing LU jinglush@126.com

2 Goal  How to define and call a function?  How to write a function?  What is the parameter in a function? What is the return value?  How to use local parameter and global parameter?  How to debug a function?

3 Practice 01  Input two integers, output the sum of the two integers, implement it using function;

4 Practice 02  Input some positive integers, ending with 0. Calculate the sum of all odd numbers. Implement it in function.

5 Practice 03  Input the coordinates of two points (x1,y1) and (x2, y2) in the plane surface. Calculate the distance of the two points. Use function distance (x1,y1,x2,y2).

6 Practice 04  Input an integer, output the factorial. Use function.

7 Result and Analysis  Why we want a function?  How is your conclusion of using a function? Advantages and disadvantages.


Download ppt " Experiment 07 Function Dr. rer.nat. Jing LU"

Similar presentations


Ads by Google