You are on page 1of 1

Worksheet for Lab Assessment.

Instruction: Write a program that demonstrates a function whose description is given in


each of the questions below.
1. That accepts an integer and returns its absolute value.
2. That accepts height in cm and returns height in meter.
3. That accepts time in minutes and converts it into hours.
4. That accepts two integers and swap them.
5. That accepts a positive integer n and returns the sum of all odd integers less than or
equals to n.
6. That accepts a positive integer and displays it factorial
7. That accepts radius of a circle and displays its area and perimeter
8. That accepts a positive integer and determine whether it is a prime or not
9. That accepts the base and exponent of exponential number and return the integer.
10. That accepts array of integers and displays the maximum and minimum number.
11. That accepts array of integer sort them in ascending order
12. That accepts date of birth of a user and returns her age.
13. That converts a positive integer converts into binary.
14. That accepts two points in x-y plane and returns their dot product and Euclidean
distance
15. That accepts two integers and return their LCM (least common multiple)
16. That accepts list of integers and compute their average and standard deviation.
17. That accepts two times which are actually expressed in Hours:Minutes:Seconds
a. For instance, beginning_time and end_time of an activity and calculate
elapsed time.
b. For instance, time it requires to complete two activities and return the total
time to complete both aactivities
18. That accepts array of employees’ gross salary and calculate their net pay after
deducting income tax and pension
19. That accepts two matrices and display their sum
20. That accepts two metrices and display their product

You might also like