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

📄 storesimulation.h

📁 数据结构
💻 H
字号:
#ifndef _storeSimulation
#define _storeSimulation

#include"simulation.h"
#include"arriveEvent.h"
#include"orderEvent.h"
#include"leaveEvent.h"

#include<iostream.h>

class storeSimulation:public simulation
{
 public:
	 storeSimulation(int chairNumber);
	 void order(unsigned int numberOfScoops);
	 void printProfits();	
    
 private:
     int freeChairs;
     double profits;
     double num;

	 friend class arriveEvent;
	 friend class leaveEvent;
	 friend class orderEvent;
};


storeSimulation::storeSimulation(int chairNumber):freeChairs(chairNumber),profits(0),simulation()
{
}

void storeSimulation::order(unsigned int numberOfScoops)
{
	num+=numberOfScoops;
}

void storeSimulation::printProfits()
{
	cout<<"一共卖出"<<num<<"支冰淇淋"<<endl;
	cout<<"总利润是"<<(profits=num*2.5)<<"人民币."<<endl;
}

extern storeSimulation store;

#endif

⌨️ 快捷键说明

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