Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions 30 Days of Code/Day 02/Operators.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
void solve(double meal_cost, int tip_percent, int tax_percent) {
// Get the Tax
double tax = (meal_cost * tax_percent) / 100;
// Get the Tip
double tip = (meal_cost * tip_percent/100);
// Total Cost
double totalCost = meal_cost + tax + tip;
// Round the total cost and output to console
cout<<round(totalCost)<<endl;
}