Coventry University Logo
4061CEM - Programming and Algorithms 1
  • Functions
    3

Functions

Before you attempt this activity, it is best that you review lecture video one from week five. You can find the video and slides on the module page.

For this activity you will be using the integrated development environment recommended by the module leader. If you need to set up your development environment, it is recommended that you check out the instructions from activity four of week one.

Are You Struggling?

If you have trouble with any of the tasks or want to check your answers are correct, then please make yourself known to a member of staff.

Task 1 - Summing Numbers

Create a function that accepts two variables, these variables can either be an integer or floating point. You will then need to sum these two values together and return the total sum.

Task 2 - Getting the Maximum of Two Numbers

Create a function that accepts two numbers, and return the maximum of the two numbers.

Task 3 - Getting the Maximum of Three Numbers

Create a function that accepts two numbers, and return the maximum of the three numbers.

Hint

For this task you may want to use the previous function you have implemented to aid in the completion of this solution.