-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSource.cpp
More file actions
39 lines (29 loc) · 835 Bytes
/
Source.cpp
File metadata and controls
39 lines (29 loc) · 835 Bytes
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
// Mauricio Sampaio Bonatte
// msnbb@mail.umkc.edu
// CS 201
// Fall 2014
// Program 5
//
// For this program, we will be working with a cash register
//
// 1 - read the products
// 2 - calculate the total price
// 3 - print a receipt
#include <fstream>
#include "Register.h" //The Cash Register
using namespace std;
int main()
{
ifstream fin("products.txt"); // This will contain all of the data needed to read in products bought.
ofstream fout("receipt.txt."); // this will contain the receipt
Register stuff; // this object will store our datas
while (fin.good())
{
stuff.addProduct(fin); //this will add the new products
}
stuff.printReceipt(fout); //this will print our Receipt
// Close our files to ensure we save our data
fin.close();
fout.close();
return 0;
}