Created
December 30, 2016 02:45
-
-
Save dzsquared/5b3f678491d24424d141d0fc58e165df to your computer and use it in GitHub Desktop.
operators created by dzsquared - https://repl.it/Ewyl/0
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
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