Skip to content

Instantly share code, notes, and snippets.

@dzsquared
Created December 30, 2016 02:45
Show Gist options
  • Save dzsquared/5b3f678491d24424d141d0fc58e165df to your computer and use it in GitHub Desktop.
Save dzsquared/5b3f678491d24424d141d0fc58e165df to your computer and use it in GitHub Desktop.
operators created by dzsquared - https://repl.it/Ewyl/0
using System;
using System.Collections.Generic;
using System.IO;
class MealCalculator {
static void Main(String[] args) {
double mealCost;
int tipPercent;
int taxPercent;
mealCost = Convert.ToDouble(Console.ReadLine());
tipPercent = Convert.ToInt32(Console.ReadLine());
taxPercent = Convert.ToInt32(Console.ReadLine());
double totalCost = (tipPercent/100.0)*mealCost;
totalCost = totalCost + ((taxPercent/100.0)*mealCost)+mealCost;
Console.WriteLine("The total meal cost is "+Math.Round(totalCost,0).ToString()+" dollars.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment