This is the third question i got from hackerrank's 30 days of code(https://www.hackerrank.com/challenges/30-operators/problem)
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.
Sample Input:
12.00
20
8
Note: Be sure to use precise values for your calculations, or you may end up with an incorrectly rounded result! Explanation
def solve(meal_cost, tip_percent, tax_percent):
tip = (tip_percent/100) * meal_cost
tax = (tax_percent/100) * meal_cost
total_cost = meal_cost + tip + tax
print(round(int(total_cost)))
Above code worked for most of the inputs given from the system expect 1 which was
10.25
17
5
my code prints 12 but the expected output is 13, my only guess is that the expected output is incorrect