皮皮学,免费搜题
登录
搜题
【简答题】
使用VC6打开考生文件夹下的工程test2_3。此工程包含一个test2_3.cpp,其中定义了类Stud,但类的定义并不完整。请按要求完成—下列操作,将程序补充完整。 (1)定义类的公有数据成员no,name[10],其中no是int型的数据,name[10]是字符型一维数组。请在注释“//**1**”之后添加适当的语句。 (2)完成函数set的定义,分别将参数n,na的值赋给数据成员no,name。注意:请使用this指针完成对no的赋值,使用字符串函数实现对name和cname的赋值。请在注释“//**2**”之后添加适当的语句。 (3)完成类的成员函数disp的定义,使其按no,deg,name和cname的顺序输出类的数据成员的值,中间使用跳格符分隔,请在注释“//**3**”之后添加适当的语句。 输出结果如下: 1 95 990701 2 83 990702 注意:除在指定的位置添加语句外,请不要改动程序中的其他语句。 源程序文件test2_3.cpp清单如下: include<iostream.h> include<string.h> class Stud { public: // ** 1 ** int deg; char cname[10]; Stud(){} void set(int n,char na[],int d,char cn[]) { // ** 2 ** deg=d; strcpy(cname,cn); } void disp() { // ** 3 ** } }; void main() { Stud obj[2]; obj[0].set(1,,'',95,'990701'); obj[1].set(2,'',83,'990702'); obj[0].disp(); obj[1].disp(); }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【简答题】起运国(地区)
【简答题】由专职司机驾驶轿车时,通常仍讲究右尊左卑,但一般以 排为上, 排为下。
【单选题】听力原文:Many women are attracted by the excitement of being a flight attendant — you earn your living and see the world at the same time. Yet, many people consider flight attendants to be simply multi-li...
A.
They do routine work and speak a few languages.
B.
They see the world and earn a lot of money.
C.
They look pretty and look after passengers.
D.
They see the world and do routine work.
【简答题】“起运国(地区)”栏:
【简答题】“起运国(地区)”栏:
【单选题】— I can't find Dad. Where is he? — I'm not sure. He be in the study room. [     ]
A.
must
B.
may
C.
need
【单选题】He ___ be in the garden.He must be in the room. ‘
A.
can't
B.
mustn’t
C.
will not
D.
may not
【简答题】Walt Disney was born in Chicago in 1901. when he was young, he lived in Kansas City. He wanted to be . Disney was very poor. He drew pictures in his father’s garage(车库). One day a mouse came into the ...
【简答题】原文:Many people being absent, the meeting had to put off.译文:____这么多人缺席,会议就只好延期召开。
【单选题】由专职司机驾驶轿车时,通常仍讲究( ),但座次同时变化为( )。
A.
左尊右卑、前排为上
B.
右尊左卑、后排为上
C.
左尊右卑、后排为上
D.
右尊左卑、前排为上
相关题目: