Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Dishwashers:5000
- Dishwashers bought:1000
- Dishwashers sold:3500
- Dishwashers left in stock:2500
- Press any key to continue . . .
- Dishwashers:450
- Dishwashers bought:20
- Dishwashers sold:125
- Dishwashers left in stock:345
- Press any key to continue . . .
- */
- #include <iostream>
- using namespace std;
- int main()
- {
- //declare variables
- int dishWashers = 0;
- int dishWashersBought = 0;
- int dishWashersSold = 0;
- int endDishWashers = 0;
- //enter data
- cout << "Dishwashers:";
- cin >> dishWashers;
- cout << "Dishwashers bought:";
- cin >> dishWashersBought;
- cout <<"Dishwashers sold:";
- cin >> dishWashersSold;
- //calulate dishwashers left at end of the month
- endDishWashers = (dishWashers + dishWashersBought) - dishWashersSold;
- //display dishwashers left
- cout << "Dishwashers left in stock:" << endDishWashers << endl;
- system ("pause");
- return 0;
- } //end of main function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement