麻烦大家去dnf怎么创建预约角色角色,帮我完成下任务。h...

共有 1131 人关注过本帖
标题:大家来帮我看一下如何把.h文件和.cpp文件,分别放到头文件和源文件中去
等 级:论坛游民
帖 子:41
专家分:26
结帖率:80%
&&已结贴√
&&问题点数:10&&回复次数:4&&&
大家来帮我看一下如何把.h文件和.cpp文件,分别放到头文件和源文件中去
//大家来帮我看一下如何把.h文件和.cpp文件,分别放到头文件和源文件中去
//这个程序没有问题的
//对银行账户的对象划分
这个作为.h文件
class Accout
&&& int password2;
&&& int ID;//这里应该用数组表示
&&& double annualInterestR
&&& Accout()
&&&&&&&&password=0;
&&&&&&&&balance=0;
&&&&&&&&annualInterestRate=0;
&&& //对字符操作有点问题
/*&&& char setname(string myname)
&&&&&&&&name=
&&& void setpassword(int mypassword2)
&&&&&& password2=mypassword2;
&&& void setdata(int mydata)&&&
&&&&&&&&data=
&&& void setID(int myid)
&&&&&&&&ID=
&&& void setdeposit(int mydeposit)
&&&&&&&&balance=
&&& void setmessage(int mypassword)
&&&&&&&&password=
&&& void setwithdrawals(int mywithdrawals)
&&&&&&&&if(mywithdrawals&=balance)
&&&&&&&&&&&&cout&&&您的余额不足!\n&;
&&&&&&&&else
&&&&&&&&&&&&cout&&&成功!&;
&&&&&&&&&&&&balance-=
&&& void setannualInterestRate(double myannualInterestRate)
&&&&&&&&annualInterestRate=myannualInterestR
&&& int getID()
&&&&&&&&return ID;
&&& int getbalance()
&&& int getdeposit()
&&&&&&&&return balance+(balance*annualInterestRate)*
&&& int getpassword()
&&& int getpassword2()
&&&&&&&&return password2;
&&& //char getname()
这个作为.cpp文件
void main()
&&&&&int n,m;
&&&&&ti.setannualInterestRate(0.005);
&&&&&cout&&&****************************个人银行管理系统*****************************&&&
&&&&&cout&&
&&&&&cout&&
&&&&&cout&&&*****************************创建一个用户********************************&&&
&&&&&cout&&&请输入您要创建的账号:&;
&&&&&cin&&n;
&&&&&ti.setID(n);
&&&&&printf(&请创建您的密码:&);
&&&&&cin&&i;
&&&&&ti.setmessage(i);
&&&&&cout&&&您的账户已经创建成功!&&&
//&&&&&ti.setname(&liuguanglei&);
&&&&&cout&&&你的当前账户余额为0!&&&&\n&;
&&&&&cout&&
&&&while(1)
&&&&&&&&cout&&&请您再次输入密码!\n&;
&&&&&&&&cin&&j;
&&&&&&&&ti.setpassword(j);
&&&&&&&&if(ti.getpassword()!=ti.getpassword2())
&&&&&&&&&cout&&&密码错误!&;
&&&&&&&&&&&& else
&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&cout&&&请您选择您要操作的菜单:&&&
&&&&&&&&&&&&&&&&&&cout&&&1-存款\n&&&&2-取款\n&&&&3-查看余额\n&&&&4-转账操作\n&;
&&&&&&&&&&&&&&&&&&cout&&
&&& while(1)
&&&&&&&&& cin&&m;
&&&&&&&&& switch(m)
&&&&&&&&& {
&&&&&&&&&&&&&&case 1:cout&&&请输入要存款的数目:\n&;
&&&&&&&&&&&&&&&&&&&&&cin&&n;
&&&&&&&&&&&&&&&&&&&&&cout&&&请输入存款的天数:&;
&&&&&&&&&&&&&&&&&&&&&cin&&k;
&&&&&&&&&&&&&&&&&&&&&ti.setdeposit(n);
&&&&&&&&&&&&&&&&&&&&&ti.setdata(k);
&&&&&&&&&&&&&&&&&&&&&cout&&&成功!\n&&&&请选择其他功能:\n&;
&&&&&&&&&&&&&&case 2:
&&&&&&&&&&&&&&&&&&&&&cout&&&请你输入要取款的金额:&;
&&&&&&&&&&&&&&&&&&&&&cin&&m;
&&&&&&&&&&&&&&&&&&&&&ti.setwithdrawals(m);
&&&&&&&&&&&&&&&&&&&&&cout&&&请选择其他功能:\n&;
&&&&&&&&&&&&&&case 3:
&&&&&&&&&&&&&&&&&&&&&cout&&&你当前的账户余额为:&&&ti.getdeposit()&&&\n&;
&&&&&&&&&&&&&&&&&&&&&cout&&&返回!\n&;
&&&&&&&&&&&&&&case 4:
&&&&&&&&&&&&&&&&&&&&&cout&&&目前本ATM机在不支持转账功能!!!\n&&&&请选择其他功能:&;
&&&&&&&&& }
&&&&&&&&&&&& }
搜索更多相关主题的帖子:
等 级:贵宾
威 望:11
帖 子:441
专家分:1882
这个还蛮有使用价值的啊 ~~先看看&&&有些地方还没学透的&&
这里只能帮顶了
有心者,千方百计;无心者,千难万难。
等 级:本版版主
威 望:134
帖 子:3296
专家分:16758
在需要用到的cpp中#include相应的头文件
还能说什么呢?
等 级:论坛游民
帖 子:30
专家分:16
在cpp文件中加上#include&,h&文件就可以了啊
等 级:业余侠客
帖 子:119
专家分:266
C++Primer推荐把类的定义,变量的extern,函数的extern 还有模板定义放在h头文件中,他们的定义放在cpp中
//文件accout.h
#ifndef ACCOUT_H
#define ACCOUT_H
class Accout
&&& int password2;
&&& int ID;//这里应该用数组表示
&&& double annualInterestR
&&& Accout()
&&&&&&&&password=0;
&&&&&&&&balance=0;
&&&&&&&&annualInterestRate=0;
&&& //对字符操作有点问题
//下面这些最好放在cpp中,并包含头文件accout.h,这些楼主自己做吧
/*&&& char setname(string myname)
&&&&&&&&name=
&&& void setpassword(int mypassword2)
&&&&&& password2=mypassword2;
&&& void setdata(int mydata)&&&
&&&&&&&&data=
&&& void setID(int myid)
&&&&&&&&ID=
&&& void setdeposit(int mydeposit)
&&&&&&&&balance=
&&& void setmessage(int mypassword)
&&&&&&&&password=
&&& void setwithdrawals(int mywithdrawals)
&&&&&&&&if(mywithdrawals&=balance)
&&&&&&&&&&&&cout&&&您的余额不足!\n&;
&&&&&&&&else
&&&&&&&&&&&&cout&&&成功!&;
&&&&&&&&&&&&balance-=
&&& void setannualInterestRate(double myannualInterestRate)
&&&&&&&&annualInterestRate=myannualInterestR
&&& int getID()
&&&&&&&&return ID;
&&& int getbalance()
&&& int getdeposit()
&&&&&&&&return balance+(balance*annualInterestRate)*
&&& int getpassword()
&&& int getpassword2()
&&&&&&&&return password2;
&&& //char getname()
这个作为.cpp文件
//包含accout.h
#include &accout.h&
void main()
&&&&&int n,m;
&&&&&ti.setannualInterestRate(0.005);
&&&&&cout&&&****************************个人银行管理系统*****************************&&&
&&&&&cout&&
&&&&&cout&&
&&&&&cout&&&*****************************创建一个用户********************************&&&
&&&&&cout&&&请输入您要创建的账号:&;
&&&&&cin&&n;
&&&&&ti.setID(n);
&&&&&printf(&请创建您的密码:&);
&&&&&cin&&i;
&&&&&ti.setmessage(i);
&&&&&cout&&&您的账户已经创建成功!&&&
//&&&&&ti.setname(&liuguanglei&);
&&&&&cout&&&你的当前账户余额为0!&&&&\n&;
&&&&&cout&&
&&&while(1)
&&&&&&&&cout&&&请您再次输入密码!\n&;
&&&&&&&&cin&&j;
&&&&&&&&ti.setpassword(j);
&&&&&&&&if(ti.getpassword()!=ti.getpassword2())
&&&&&&&&&cout&&&密码错误!&;
&&&&&&&&&&&& else
&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&cout&&&请您选择您要操作的菜单:&&&
&&&&&&&&&&&&&&&&&&cout&&&1-存款\n&&&&2-取款\n&&&&3-查看余额\n&&&&4-转账操作\n&;
&&&&&&&&&&&&&&&&&&cout&&
&&& while(1)
&&&&&&&&& cin&&m;
&&&&&&&&& switch(m)
&&&&&&&&& {
&&&&&&&&&&&&&&case 1:cout&&&请输入要存款的数目:\n&;
&&&&&&&&&&&&&&&&&&&&&cin&&n;
&&&&&&&&&&&&&&&&&&&&&cout&&&请输入存款的天数:&;
&&&&&&&&&&&&&&&&&&&&&cin&&k;
&&&&&&&&&&&&&&&&&&&&&ti.setdeposit(n);
&&&&&&&&&&&&&&&&&&&&&ti.setdata(k);
&&&&&&&&&&&&&&&&&&&&&cout&&&成功!\n&&&&请选择其他功能:\n&;
&&&&&&&&&&&&&&case 2:
&&&&&&&&&&&&&&&&&&&&&cout&&&请你输入要取款的金额:&;
&&&&&&&&&&&&&&&&&&&&&cin&&m;
&&&&&&&&&&&&&&&&&&&&&ti.setwithdrawals(m);
&&&&&&&&&&&&&&&&&&&&&cout&&&请选择其他功能:\n&;
&&&&&&&&&&&&&&case 3:
&&&&&&&&&&&&&&&&&&&&&cout&&&你当前的账户余额为:&&&ti.getdeposit()&&&\n&;
&&&&&&&&&&&&&&&&&&&&&cout&&&返回!\n&;
&&&&&&&&&&&&&&case 4:
&&&&&&&&&&&&&&&&&&&&&cout&&&目前本ATM机在不支持转账功能!!!\n&&&&请选择其他功能:&;
&&&&&&&&& }
&&&&&&&&&&&& }
饿....机器问题,没有测试,凑活看看吧....反正只有第一段话是重点....
版权所有,并保留所有权利。
Powered by , Processed in 0.031583 second(s), 8 queries.
Copyright&, BCCN.NET, All Rights Reserved里面有段英文写的是什么,我这关过不去,麻烦大家帮我翻译下任务有什么要求_百度知道
里面有段英文写的是什么,我这关过不去,麻烦大家帮我翻译下任务有什么要求
baidu.baidu.hiphotos://b.jpg" target="_blank" title="点击查看大图" class="ikqb_img_alink"><img class="ikqb_img" src="http.jpg" esrc="http.baidu.hiphotos.<a href="http&/zhidao/wh%3D450%2C600/sign=/zhidao/pic//zhidao/wh%3D600%2C800/sign=eb8246d7dff9d72aa040c/fadab4bbb31c://b://b
提问者采纳
A是银行的CEO,我们得知他将在今天下午在主厅入口下车,去阻止他!
提问者评价
太给力了,你的回答完美地解决了我的问题,非常感谢!
其他类似问题
为您推荐:
其他1条回答
你应该救他,帮助他打败敌人。消灭敌人
这段话写的什么
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁梦幻诛仙角色创建
进入游戏界面后,会让你去创建一个新角色,不用详细介绍了吧?
查看更多关《梦幻诛仙》诚挚邀请各路高手或者}

我要回帖

更多关于 龙之谷创建外传角色 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信