Created
December 1, 2020 22:53
-
-
Save mattsegura/7676d626e47f7f134394d8815e2ebcb5 to your computer and use it in GitHub Desktop.
bookcal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// book discounts | |
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
const double book_price = 5.00; | |
// Variables | |
int books, original_price; | |
cout << "\nEnter the amount of books sold: "; | |
cin >> books; | |
original_price = book_price * books; | |
if (original price >= 0 && <= 4) | |
{ | |
cout << "Total cost for " << books | |
<< " books = $" << | |
(original_price - (original_price * .2)) << endl; // 5 percent | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment