We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 2: Operators
Day 2: Operators
Sort by
recency
|
3404 Discussions
|
Please Login in order to post a comment
Hi, Why this statement doesn't work?? double tip=(tip_percent/100)meal_cost; instead if I give (tip_percent)(meal_cost/100); will work
Write your code here
i am using def function but this is not exixt
function solve(meal_cost, tip_percent, tax_percent) { // Write your code here const tip = (tip_percent/100) * meal_cost; const tax = (tax_percent/100) * meal_cost; const total_cost = meal_cost + tip + tax; console.log(Math.floor(total_cost)); }
why my code doesn't work for the last test case that it works fine for the rest three test cases.print(round((meal_cost + (meal_cost * tip_percent / 100) + (meal_cost * tax_percent / 100))))