Created
July 7, 2021 04:05
-
-
Save schauhan232/adfe8597738098558151418341a4093a to your computer and use it in GitHub Desktop.
Hackerrank : Day 2 : Operators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void solve(double meal_cost, int tip_percent, int tax_percent) | |
{ | |
double tip = (meal_cost /100) * tip_percent; | |
double tax = (meal_cost / 100) * tax_percent; | |
double total_cost = meal_cost + tip + tax; | |
Console.WriteLine(Math.Round(total_cost)); | |
} | |
*/ | |
Note: I found issue in explanation for tax, it should be | |
(8/100) * 12 | |
/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment