blob: ef6d9030b1d3ad7637a97fbde6049bca8e83c2ee (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
// Name: msglm
// Date: Feb-14-2022
// Program Name: Bookstore Receipt Program
// Description: a program that will calculate the price (plus tax) of a book store recieipt
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
// Named constants
double const TAX = 0.0964;
double const BOOKPRICE = 5.00;
double const COPYPRICE = 1.10;
double const PENPRICE = 1.15;
double const FOLDERPRICE = 1.00;
int main() {
//Variable declaration
int book, copy, pen, folder;
double total;
//Program title and description for the user
cout << "Title: Bookstore Receipt Program" << endl << "Description: a program that will calculate the price (plus tax) of a book store recieipt" << endl;
// User input
cout << "How many books would you like?\n";
cin >> book;
cout << "How many packs of copy paper would you like?\n";
cin >> copy;
cout << "How many packs of pens would you like?\n";
cin >> pen;
cout << "How many folder packs would you like?\n";
cin >> folder;
// Calculations for the total price (Without Tax)
total = (book*BOOKPRICE + copy*COPYPRICE + pen*PENPRICE + folder*FOLDERPRICE);
// Output to the screen
cout << "Receipt: \n";
cout << "Books: $" << book*BOOKPRICE << endl;
cout << "Packs of Copy Paper: $" << copy*COPYPRICE << endl;
cout << "Packs of Pens: $" << pen*PENPRICE << endl;
cout << "Packs of Folders: $" << folder*FOLDERPRICE << endl;
cout << "Total (Without Tax): $" << total << endl;
cout << "Total Tax: $" << total*TAX << endl;
cout << "Total (With Tax): $" << total+(total*TAX) << endl;
return 0;
}
/*This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
|