forked from ChicoState/NotPOSPOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cashierView.cpp
35 lines (33 loc) · 1.05 KB
/
cashierView.cpp
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
#include <iostream>
#include <iomanip>
#include <vector>
#include "cashierView.h"
void cashierView::displayRunningTotal(order running)
{
std::cout<<"================\n"
<<"CASHIER'S SCREEN\n";
std::vector <item> cart = running.getItems();
std::cout<<std::setprecision(2)<<std::fixed;
for(int i=0; i<cart.size(); i++)
{
std::cout<<cart[i].getName()<<" $"<<cart[i].getPrice()<<std::endl;
}
std::cout<<"SUBTOTAL: $"<<running.getSubtotal()<<std::endl
<<"================\n";
}
void cashierView::displayFinalReceipt(order final)
{
std::cout<<"================\n"
<<"CASHIER'S SCREEN\n";
std::vector <item> cart = final.getItems();
std::cout<<std::setprecision(2)<<std::fixed;
for(int i=0; i<cart.size(); i++)
{
std::cout<<cart[i].getName()<<" $"<<cart[i].getPrice()<<std::endl;
}
std::cout<<"SUBTOTAL: $"<<final.getSubtotal()<<std::endl
<<"TAXES: $"<<final.getTax()<<std::endl
<<"----------------\n"
<<"TOTAL: $"<<final.getTotal()<<std::endl
<<"================\n";
}