Problem Set 0#

Tip Calculator#

In some countries, it’s customary to leave a tip for your server after dining in a restaurant, typically an amount equal to 15% or more of your meal’s cost. You need to write a function called tip_calculator() to calculate and print the tips you want to pay.

Users has to enter the cost of the meal, as well as the percentage of the cost as tips.

Einstein#

Even if you haven’t studied Theory of relativity, you might have heard that, wherein \(E = mc^2\)., where \(E\) represents energy (measured in Joules), \(m\) represents mass (measured in kilograms), and c represents the speed of light (measured approximately as 300000000 meters per second), per Albert Einstein et al. Essentially, the formula means that mass and energy are equivalent.

Write a function that prompts the user for mass as an integer (in kilograms) and then outputs the equivalent number of Joules as an integer. Assume that the user will input an integer.

Geometry I#

Please type the code example Geometry Formulas in onlineGDB. Run the code and test it with your inputs. It is recommended to manually type the code by yourself, but copy and paste is fine as well.

Geometry II#

Please write at least three other functions to calculate the area or volume of different shapes. You can check out here: https://www.cuemath.com/geometry-formulas/