This commit is contained in:
xixu-me committed 2024-04-17 20:08:19 +08:00
1 parent 72039ef643
commit 96aa932d73
5 files changed

No files matched your search

+45
View File
@@ -0,0 +1,45 @@
package shopping;
public class Customer {
private String strName;
private float fMoney;
ShopCar sc;
public Customer(String strName, float fMoney) {
this.strName = strName;
this.fMoney = fMoney;
this.sc = new ShopCar();
}
public void pay(float sun) {
this.fMoney -= sun;
}
public void addGood(Good gd) {
this.sc.add(gd);
}
public String getName() {
return this.strName;
}
public float getMoney() {
return this.fMoney;
}
public ShopCar getShopCar() {
return this.sc;
}
public void setName(String strName) {
this.strName = strName;
}
public void setMoney(float fMoney) {
this.fMoney = fMoney;
}
public void setShopCar(ShopCar sc) {
this.sc = sc;
}
}