Professional Documents
Culture Documents
Sheet 4 21-10-2017
Question one:
1. Write an overloaded function minimum that takes two parameters either of type double or integer
and returns the smaller of them.Write Program to test these functions
Examples: Min_fun(2.5,4.8) double
Min_fun(8,11) int
2. Write an overloaded function area that takes either :
a. The width and height of a rectangle and calculates its area (A=W*H)
b. Or the radius of a circle and calculates its area. ( = 2 )
3. Write program allows user to enter time spent on calls in hours, minutes and seconds .Write
function calculates Total amount to be paid due to the duration entered
User pays 1$ for each 10 minutes (const int PRICE_PER_10MINS = 1 ;)
Minutes = Seconds / 60.0
Minutes = Hours * 60.0