A program is required to calculate the cost of a plumber’s visit. If it is a non-immediate job, a plumber charges a £100 call out fee that also covers the first hour (60 minutes) of work. Each whole hour, or part of an hour, after that is charged at £50. However, if it is an immediate job, the call out fee (that covers the first hour) is £200 and each hour or part of an hour after that is charged at £80. So, for example, if the plumber takes 183 minutes to complete an immediate job, the first 60 minutes costs £200. The remaining 123 minutes cost £240 as there are 2 complete hours and then part of an hour, which are each charged at £80, making a total bill of £440. For the same number of minutes for a non-immediate job, the total bill is £100 for the call out and £150 for the hours and part hour, so the total bill is £250.

# Problem: Calculate plumber’s bill.

# Input: minutes worked

# Input: True if immediate, False otherwise

# Output: cost

minutes = 61

immediate = False

cost = 0

hours = 1

if minutes > 60 :

hours = minutes // 60

if minutes % 60 == 0 :

hours = minutes // 60 − 1

if immediate

cost = 200 + hours * 80

if not immediate:

cost = 100 + hours * 50

print(cost)

# Problem: Calculate plumber’s bill.

# Input: minutes worked

# Input: True if immediate, False otherwise

# Output: cost

minutes = 61

immediate = False

cost = 0

hours = 1

if minutes > 60 :

hours = minutes // 60

if minutes % 60 == 0 :

hours = minutes // 60 − 1

if immediate

cost = 200 + hours * 80

if not immediate:

cost = 100 + hours * 50

print(cost)