| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 539 人关注过本帖
标题:CANDY MACHINE 里CLASS FUNCTION 怎么加
只看楼主 加入收藏
lyym88
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-1-17
收藏
 问题点数:0 回复次数:0 
CANDY MACHINE 里CLASS FUNCTION 怎么加

// Candy Machine Header File


#ifndef CANDYMACHINE_H
#define CANDYMACHINE_H

//** class cashRegister **//

class cashRegister
{
public:
cashRegister();
cashRegister();
private:
float
float
};


//*********** class dispenserType

class dispenserType
{
public:
dispenserType();
dispenserType();
private:
float
float
};

#endif



----------------------------------------------------
// Main program:

#include <iostream>
#include "candyMachine.h"
using namespace std;

void showSelection();
void sellProduct(dispenserType& product, cashRegister& pCounter);

int main()
{
cashRegister counter;
dispenserType candy(100,50);
dispenserType chips(100,65);
dispenserType gum(75,45);
dispenserType cookies(100,85);

int choice; //variable to hold the selection

showSelection();
cin>>choice;

while(choice != 9)
{
switch(choice)
{
case 1: sellProduct(candy, counter);
break;
case 2: sellProduct(chips, counter);
break;
case 3: sellProduct(gum, counter);
break;
case 4: sellProduct(cookies, counter);
break;
default: cout<<"Bad Selection"<<endl;
}//end switch
showSelection();
cin>>choice;
}//end while

return 0;
}//end main

void showSelection()
{

/********************************
**** Complete this function ****
********************************/

}//end showSelection

void sellProduct(dispenserType& product, cashRegister& pCounter)
{

/********************************
**** Complete this function ****





------------------------------------------------
//Implementation file candyMachineImp.cpp
//This file contains the definition of the functions
//to implement the operations of the classes
//cashRegister and dispenserType.

#include <iostream>
#include "candyMachine.h"
using namespace std;

int cashRegister::currentBalance()
{

/********************************
**** complete this section ***
********************************/

}

void cashRegister::acceptAmount(int amountIn)
{
/********************************
**** complete this section ***
********************************/
}

cashRegister::cashRegister(int cashIn)
{
/********************************
**** complete this section ***
********************************/
}

int dispenserType::count()
{
/********************************
**** complete this section ***
********************************/
}

int dispenserType::productCost()
{
/********************************
**** complete this section ***
********************************/
}

void dispenserType::makeSale()
{
/********************************
**** complete this section ***
********************************/
}

dispenserType::dispenserType(int setNoOfProducts, int setCost)
{
/********************************
**** complete this section ***
********************************/
}
我想做个CANDY MACHINE 但是基本都完成了就差一些FUNCTION拉,谁能帮帮我加上去

搜索更多相关主题的帖子: CANDY FUNCTION MACHINE CLASS 
2006-04-24 18:50
快速回复:CANDY MACHINE 里CLASS FUNCTION 怎么加
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014797 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved