Created
January 28, 2013 23:29
-
-
Save jpetto/4660273 to your computer and use it in GitHub Desktop.
Tip calculator - pseudo code exercise.
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
string str_service_type = "good"; | |
double dbl_tip_percentage = 0; | |
double dbl_food_total = 24.55; | |
double dbl_tip; | |
if (str_service_type == "good") { | |
dbl_tip_percentage = .15; | |
} else if (str_service_type == "great") { | |
dbl_tip_percentage = .2; | |
} else { | |
dbl_tip_percentage = .1; | |
} | |
dbl_tip = (dbl_food_total * dbl_tip_percentage); | |
Console.WriteLine("The tip should be " + dbl_tip); | |
str_service_type = "poor"; | |
Console.WriteLine(str_service_type); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment