COMP1126 Tutorial 1b
COMP1126 Tutorial 1b
Department of Computing
COMP1126–Introduction to Computing I
Tutorial 1B
Question 1
Write a function in python calcFahrenheit that converts Celsius temperature to Fahrenheit
temperatures. The formula is as follows:
9
F C 32
5
The program takes a Celsius value as an argument and returns the equivalent Fahrenheit value.
Question 2
A function is_coldday takes the temperature as Fahrenheit value as an argument and returns true if
the temperature is less than 50o F and false otherwise.
Question 3
Write python functions to capture the process descriptions given below:
1. A function of one argument that returns double the value of the argument.
2. A function of two arguments that returns the smaller of them.
3. A function of two arguments that returns 1 if the first argument is negative, but the second
argument otherwise.