Math Functions - Exercise¶
Let’s practice using the mathematical functions we have learned.
Task - advertising:
Thomas distributes advertising packages containing one calendar, a keychain and a pen. Write a program that loads how many calendars, keychains, and pens Thomas has and then prints how many advertising packages he can make.
To finish the program insert one of the mathematical functions you have learned.
Task - lemonade:
A group of people set out on a journey and Zoe made lemonade for everyone. Write a program that loads how many liters of lemonade Zoe has made (as a real number), then writes how many half-liter bottles can be filled with that lemonade and how many bottles it takes for all the lemonade (the two numbers can vary by one at most).
To complete the following program, use some of the rounding functions.
Task - the game:
The six friends agreed to get on the playground at a certain time and play a game. Write a program that loads the delay time of each player in minutes (as whole numbers) and prints with how many minutes of delay the match could have started.
One possible solution is partially written below. Try to complete it.
Task - two buses:
Maya and Lola travel on the same highway in two different buses and talk on the phone. One of them has just noticed the milestone x and the other y. Write a program that loads integers: x and y and prints how many miles Maya and Lola are away from each other.
Task - Video lessons
The course consists of several video lessons that all last equally. You have decided to devote 90 minutes to this course every day and you want to know how many days it will take for the whole course. Write a program that loads the number of lessons and the duration of one lesson in minutes, and prints the required number of days, rounded to the nearest integer.