s
This commit is contained in:
1 parent
72039ef643
commit
96aa932d73
5 files changed
No files matched your search
@@ -0,0 +1,44 @@
|
||||
package shopping;
|
||||
|
||||
public class Cashier {
|
||||
private String strName;
|
||||
private float fMoney;
|
||||
|
||||
public Cashier(String strName, float fMoney) {
|
||||
this.strName = strName;
|
||||
this.fMoney = fMoney;
|
||||
|
||||
}
|
||||
|
||||
public void cash(Customer cm) {
|
||||
float total = cm.getShopCar().getTotal();
|
||||
cm.pay(total);
|
||||
this.fMoney += total;
|
||||
}
|
||||
|
||||
public void print(Customer cm) {
|
||||
System.out.println("Cashier: " + this.fMoney);
|
||||
System.out.println("Customer: " + cm.getMoney());
|
||||
Good gd;
|
||||
for (int i = 0; i < cm.sc.liCar.size(); i++) {
|
||||
gd = cm.sc.liCar.get(i);
|
||||
System.out.println("name: " + gd.getName() + " price: " + gd.getPrice());
|
||||
}
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.strName;
|
||||
}
|
||||
|
||||
public float getMoney() {
|
||||
return this.fMoney;
|
||||
}
|
||||
|
||||
public void setName(String strName) {
|
||||
this.strName = strName;
|
||||
}
|
||||
|
||||
public void setMoney(float fMoney) {
|
||||
this.fMoney = fMoney;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user