首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。 【C++程序】 #include < stdio. h > #include < string. h > #define Max 1000 class Bank { int inde
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。 【C++程序】 #include < stdio. h > #include < string. h > #define Max 1000 class Bank { int inde
admin
2009-05-15
15
问题
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。
【C++程序】
#include < stdio. h >
#include < string. h >
#define Max 1000
class Bank
{
int index;
char date [Max] [10]; // 记录交易日
iht amount[Max]; // 记录每次交易金额,以符号区分存钱和取钱
int rest[ Max]; // 记录每次交易后余额
static iht sum; // 账户累计余额
public:
Bank( ) {index =0;}
void deposit( char d[ ] , int m) //存入交易
{
strcpy ( date [ index ], d);
amount[ index] = m;
(1);
rest[ index] = sum;
index++;
}
void withdraw (char d[ ], int m) //取出交易
{
strcpy( date[ index] ,d);
(2);
(3);
rest[ index] = sum;
index++;
}
void display( );
};
int Bank:: sum = 0;
void Bank:: display ( ) //输出流水
{
int i;
printf("日期 存入 取出 余额\n");
for (4)
{
printf(" %8s" ,date
);
if (5)
printf(" %6d" , -amount
);
else
printf( "%6d ",amount
);
printf( "% 6d\n" ,rest
);
} }
void main( )
{
Bank object;
object. deposit ( "2006.2.5", 1 00 );
object. deposit( "2006.3.2" , 200);
object. withdraw( "2006.4.1", 50);
object. withdraw( "2006.4.5", 80);
object. display ( );
}
本程序的执行结果如下:
日期 存入 取出 余额 2006.2.5 100 100
2006.3.2 200 300
2006.4.1 50 250
2006.4.5 80 170
选项
答案
(1)sum=sum+ m
解析
存钱时,账户余额属加。
转载请注明原文地址:https://kaotiyun.com/show/BujZ777K
本试题收录于:
程序员上午基础知识考试题库软考初级分类
0
程序员上午基础知识考试
软考初级
相关试题推荐
以下(1)是WindowsServer2003的Internet信息服务(IIS)管理器新增的服务功能。在WindowsServer2003操作系统中,邮件服务器中通过域来提供邮件服务。通常,域用户信息存储于(2)中。(1)A.WWW服
阅读以下说明,回答问题1至问题5。【说明】某服务器既是Web站点又是FTP服务器,Web站点的域名为www.test.com,Web站点的部分配置信息如图2-1所示,FTP服务器的域名为ftp.test.com。Windo
客户小郭要求将其计算机通过电话线宽带接入Internet,则小郭的计算机通常需要添加哪些外部网络设备?除此之外,小郭还需从网络服务提供商(ISP)获得哪些信息才能宽带接入到Internet?在电子商务公司A的内部局域网中,计算机PC15无法访问B公司的
在一台计算机上安装完成WindowsServet2003服务器及相应的服务组件。如果这台服务器是域控制器,为方便用户管理和资源授权需要建立用户组,那么组有哪些类型?组的作用域有哪些?
DNS的主要功能是什么,DNS解析域名的方式有哪些?DNS服务器有几种类型,分别是什么?
DNS是应用最广泛的主机名和IP地址的转换机制,它使用(1)来处理网络中成千上万个主机和IP地址的转换。在Linux中,DNS是由BIND软件来实现的。BIND是一个(2)系统,其中的resolver程序负责产生域名信息的查询,一个称为(3)的守护进程负责
DNS是应用最广泛的主机名和IP地址的转换机制,它使用(1)来处理网络中成千上万个主机和IP地址的转换。在Linux中,DNS是由BIND软件来实现的。BIND是一个(2)系统,其中的resolver程序负责产生域名信息的查询,一个称为(3)的守护进程负责
请根据图6-15网页的显示效果,解释该ASP程序中用下画线标出的语句的含义,即填写(1)、(3)、(4)、(6)、(10)空缺处的解释内容。请根据图6-15网页的显示效果,将ASP程序中(2)、(5)、(7)、(8)、(9)空缺处的代码补充完整。
阅读以下关于SNMPUTIL程序在某大学城网络管理中应用的技术说明,根据要求回答问题1~问题5。【说明】某大学城一期网络工程的部分拓扑结构如图6-6所示。其中,楼层交换机1~49均为可远程Web管理和命令行管理的24口交换机。每个交换机组成一个V
随机试题
反映财务弹性的指标是()。
导游服务的主要范围主要包括导游讲解服务,旅行生活服务,市内交通服务。()
组成药物中含有芍药的方剂是组成药物中含有薄荷的方剂是
出血性与缺血性脑血管疾病的鉴别,除临床表现外,最有诊断意义的辅助检查是
在规范性文件的系统化方式中,属于立法活动的有( )。
对职业伤害事故,按照其后果的严重程度分类,特大伤亡事故是指一次死亡()人及其以上的事故。
目前较为流行的金融衍生工具主要有()。
作为一种社会经济形态,商品经济的直接目的是()。
Dianadoesn’thavetime,butifshe______moretime,she_____tothegym.
TheHumanBrainThebrainisthemostcomplexorganinhumanbody.Itproducesoureverythought,action,memory,feelingan
最新回复
(
0
)