Final 2016 Q 1.3:
A shark can only stay in a tank for a specific period of time before it has to be released. The user has to enter the lifespan of a shark in a tank in months.
Write code to convert the number of months entered into years and months and display the years and months as shown in the example below.
Example of output if the number of months was entered as 87:
7 years and 3 months.
Supplementary 2015 Q 1.2.3:
One litre of paint is used to paint an area of eight square metres.
The user will enter the length and width of the area to be painted.
The pricing structure of paint per drum is as follows:
1-litre drum R 55.50
2-litre drum R 92.30
5-litre drum R 199.00
The total cost must be displayed rounded to two decimal places.
Display the calculated values in the provided output area using the format below:
Example: If the length and width were entered as 4m by 37m, the output will be as follows:
Area: 148 square metres
Volume of paint required: 18.5 litres
1-litre drums: 0
2-litre drums: 2
5-litre drums: 3
Total cost: R 781.60