⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cartitem.java

📁 基于 C/S 模式的网上购物系统
💻 JAVA
字号:
package RegisterAndLogin;

//购物车中的一个条目
import java.io.Serializable;
class CartItem implements Serializable
{
	merchandise goods=null;
	int quantity=0;
	
	public CartItem(merchandise goods)
	{
		this.goods=goods;
		this.quantity=1;
	}
	
	public void setgoods(merchandise goods)
	{
		this.goods=goods;
	}
	public merchandise getgoods()
	{
		return goods;
	}
	
	public int getQuantity()
	{
		return quantity;
	}
	public void setQuantity(int quantity)
	{
		this.quantity=quantity;
	}
	
	public float getItemPrice()
	{
		float price=goods.getPrice()*quantity;
		long val=Math.round(price*100);
		return val/100.0f;
		
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -