Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- bool addTax(float x, float &tax) {
- if (x > 50) {
- tax = x * (1 + tax / 100);
- return 1;
- }
- else {
- return 0;
- }
- }
- int main() {
- float value = 0;
- float tax = 0;
- int flag;
- cout << "Enter the value of the item \n";
- cin >> value;
- cout << "Enter the value of the percantage of taxes\n";
- cin >> tax;
- flag =addTax(value, tax);
- if (flag) {
- cout << "The item is taxable " << endl;
- cout << "The cost after adding taxes is " << tax << endl;
- }
- else {
- cout << "The item is intaxable \n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement