Task 1a Task 1b Task 1c Task 1d

A game maker needs large wooden dice to be painted. The cost is $7/cm2 if normal paint paint is used.

It needs a computer program to help calculate the total cost of painting the 6 sides of a large wooden dice.

Task 1a

A function, getSurfaceArea, takes the width and length of the side of a dice in cms and returns the total surface area ie length*height*6:

Complete the function design:

#function definition

def getSurfaceArea(l,w):

#your code here

Task 1b

A function, getpaintQuality(), asks a user which paint they want to use, normal or premium. The user enters their choice.

While the choice is not normal and the choice is not premium, the function keeps asking them to enter their choice!

Finally the function returns their choice.

Complete the function design:

def getPaintQuality():

#your code here

Task 1c

A function, calculateTotalCost(), takes the surface area of a large wooden dice and a paint quality as parameters. Depending on the paint quality, it calculates and returns the total cost of painting the room.

Premium paint always costs twice as much as Normal paint.

Complete the function design:

def calculateTotalCost(sa, pq):

#your code here

Task 1d

A function, displayResult(), takes the surface area of a large wooden dice, a paint quality, and a total cost as parameters. It displays the information in a sentence.

It does not return anything.

Complete the function design:

def displayResult(surface, paintQ, tCost):

#your code here

Let's write a program!

Using the available functions, write a computer program that will calculate and display the total cost of painting the 6 sides of a large wooden dice with a chosen paint quality.