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
31 changes: 31 additions & 0 deletions Day20-Operators.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <bits/stdc++.h>

using namespace std;

//solve function below.

void solve(double meal_cost, int tip_percent, int tax_percent) {

int total_cost;
total_cost = meal_cost + meal_cost * tip_percent/100 + meal_cost * tax_percent/100;
cout << total_cost <<endl;
}

int main()
{
double meal_cost;
cin >> meal_cost;
cin.ignore(numeric_limits<streamsize>::max(), '\n');

int tip_percent;
cin >> tip_percent;
cin.ignore(numeric_limits<streamsize>::max(), '\n');

int tax_percent;
cin >> tax_percent;
cin.ignore(numeric_limits<streamsize>::max(), '\n');

solve(meal_cost, tip_percent, tax_percent);

return 0;
}