30 Day code challenge- python
Day 2— Operators
Task
Given the meal price (base cost of a meal), tip percent (the percentage of the meal price being added as tip), and tax percent (the percentage of the meal price being added as tax) for a meal, find and print the meal’s total cost. Round the result to the nearest integer.
Input Format
There are lines of numeric input:
The first line has a double, (the cost of the meal before tax and tip).
The second line has an integer, (the percentage of being added as tip).
The third line has an integer, (the percentage of being added as tax).
Output Format
Round total to the nearest integer and print the result
Explanation
The first three lines get input from the user.
Line 4, 5: Calculates the final tip and tax values
Line 6: prints final output which adds meal, final tip and tax where round function rounds the value to the nearest
Bonus Tip: print(round(meal + Final_tip + Final_tax, 2)). The output will be 15.36 I.e It rounds to the nearest 2 decimals
See you on day 3