Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Christian Ballard
- //COSC 1330 - 003
- //This program allows the salesclerk to display the total amount the customer owes.
- #include <iostream>
- using namespace std;
- int main()
- {
- //Variables
- double item1 = 0.0;
- double item2 = 0.0;
- double halfOff = .5;
- double total = 0.0;
- //Inputs
- cout << "Enter the first items price " << endl;
- cin >> item1;
- cout << "Enter the second items price " << endl;
- cin >> item2;
- //Problem
- if (item1 <= item2)
- {
- total = (item2 + item1 * halfOff);
- }
- else
- {
- total = (item1 + item2 * halfOff);
- }
- //Output
- cout << "The total is: " << total << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment