Day 2 of 30 Days of Code at HackerRank
Day 2: Operators
Objective:
In this challenge, you’ll work with arithmetic operators. Check out the Tutorial tab for learning materials and an instructional video!
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, mealCost(the cost of the meal before tax and tip).
The second line has an integer, tipPercent (the percentage of mealCost being added as tip).
The third line has an integer, taxPercent(the percentage of mealCost being added as tax).
Output Format
Print the total meal cost, where total cost is the rounded integer result of the entire bill , mealCost( with added tax and tip).
Sample Input
12.00
20
8
Sample Output
15
Explanation
Given:
Solution:
Implementation in Python Language: —
Thanks for reading….
If you like it or found useful then give a clap👏, so I’ll inspire by your response and will bring a lot of great contents for you.