Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Day20-Operators.cpp #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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;
}