cashregister.h

来自「糖果机的取糖程序」· C头文件 代码 · 共 31 行

H
31
字号
#ifndef CASHREGISTER_H_
#define CASHREGISTER_H_

class cashRegister
{
public:
	int currentBalance();
	    //Function to show the current amount in the cash register.
	    //Postcondition: The value of cashOnHand is returned.
	void acceptAmount(int amountIn);
	    //Function to receive the amount deposited by the customer and
	    //update the amount in the cash register.
	    //Postcondition:cashOnHand=cashOnHand+amountIn.
	cashRegister(int cashIn=500);
	    //Constructor to set the cash in the register to a specific amount.
	    //Postcondition:cashOnHand=cashIn.
	    //If no value is specified when the object is declared,the default
	    //value assigned to cashOnHand is 500.

private:
	int cashOnHand;            //variable to store the cash in the register.
};


#endif





⌨️ 快捷键说明

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