纠错
全专业资料、题库、学位、网课
最高直省2344元
上千+科次精品网课
买网课即送全真模考题库
五千+科次教材资料
电子资料满三件9折
五千+科次在线题库
全真呈现历年考试试题
1、[单选题]假定AA为一个类,a为该类公有的数据成员,x为该类的一个对象,则访问x对象中数据成员a的格式为().
2、[主观题]根据下面的主程序基输出结果,补上所缺类文件。#include#include″base.h″voidmain{basex;x.init(6.5,3.8);x.show;}输出结果:2.7
3、[主观题]写出下面程序的输出结果。#includeclasslocation{intX,Y;public:voidinit(int=0,int=0);voidvalueX(intval){X=val;}intvalueX{returnX;}voidvalueY(intval){Y=val;}intvalueY{returnY;}};voidLocation::init(intinitX,intinitY){X=initX;Y=initY;}voidmain{LocationA,B;A.init;cout
4、[主观题]下面是以传统形式的struct来定义一存放字符的栈类型,并定义了有关栈操作的各种函数。编写一主函数,定义并输入一个字符串,用此串来验证栈的各种操作,包括把串压入栈中后再弹出,以相反的次序将它们显示出来。#include″iostream.h″constmax—len=1000;enunboolean{—false,—true};enum{EMPTY=-1,FULL=max—len-1};structstack{chars[max—len];inttop;};voidreset(stack*st){st->top=EMPTY;}voidpust(charc,stack*st){st->top++;st->s[st->top]=c;}charpop(stack*st){return(st->s[st->top--]);}chartop(stack*st){return(st->s[st->top]);}booleanempty(conststack*st){return(boolean)(st->top==EMPTY);}booleanfull(conststack*st){return(boolean)(st->top==FULL);}
5、[主观题]关键字private、public、protected以后的成员的访问权限分别是___、___和___。如果没有使用关键字,则所有成员缺省定义为___权限。
Copyright © 2010 - 2023 湖南求实创新教育科技有限公司 All Right Reserved.
温馨提示:如您需要的资料本网暂时没有,请于工作日08:00-18:00,点击这里,联系客服及时补充资料。