View on GitHub

30daysofcode

Try a new challenge every day for 30 days. By the end of the month, you'll go from newbie to expert.

Day 2 - Operators

Objective

In this challenge, you’ll work with arithmetic 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.

Note: Be sure to use precise values for your calculations, or you may end up with an incorrectly rounded result!

Input Format

There are 3 lines of numeric input: The first line has a double, meal_cost (the cost of the meal before tax and tip). The second line has an integer, tip_percent (the percentage of being added as tip). The third line has an integer, tax_percent (the percentage of being added as tax).

Output Format

Print the total meal cost, where total_cost is the rounded integer result of the entire bill (meal_cost with added tax and tip).

Sample Input

12.00
20
8

Sample Output

15