Skip to content

Instantly share code, notes, and snippets.

@schauhan232
Created July 7, 2021 04:05
Show Gist options
  • Save schauhan232/adfe8597738098558151418341a4093a to your computer and use it in GitHub Desktop.
Save schauhan232/adfe8597738098558151418341a4093a to your computer and use it in GitHub Desktop.
Hackerrank : Day 2 : Operators
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