阅读以下说明和C++程序代码,将应填入 (n) 处的字句写在答题纸的对应栏内。 [说

题型:填空题

问题:


阅读以下说明和C++程序代码,将应填入 (n) 处的字句写在答题纸的对应栏内。
[说明]
在下面的C++代码中,类SalesTicket能够完成打印票据正文的功能,类HeadDecorator与FootDecorator分别完成打印票据的抬头和脚注的功能。已知该程序运行后的输出结果如下所示,请填补该程序代码中的空缺。
这是票据的抬头!
这是票据正文!
这是票据的脚注!
--------------------------------------
这是票据的抬头!
这是票据的脚注!
[C++程序代码]
#include<iostream>
using namespace std;
class SalesTicket{
public;
(1) printTicket(){cout<<"这是票据正文!"<<endl;}
};
class Decorator:public SalesTicket{
SalesTicket *ticket;
public:
Decorator (SalesTicke *t){ticket=t;}
void printTicket (){
if (ticket!=NULL)
ticket->printTicket() ;
}
};
class HeadDecorator:public Decorator{
public:
HeadDecorator(SalesTicket *t): (2) {}
void printTicket(){
cout<<"这是票据的抬头!" <<endl;
Decorator::printTicket();
}
};
class FootDecorator:public Decorator{
public:
FootDecorator(SalesTicket *t): (3) {}
void printTicket(){
Decorator::printTicket();
cout<<"这是票据的脚注!"<<endl;
}
};
void main (void){
SalesTicket t;
FootDecorator f(&t);
HeadDecorator h( (4) );
h.printTicket();
cout<<"---------------------"<<endl;
FootDecorator a(NULL);
HeadDecorator b( (5) );
b.printTicket();
}

考点:计算机软件水平考试初级程序员初级程序员下午试题
题型:填空题

固定列车运行线

题型:填空题

A man with a big camera in his hands stopped me and asked, “Excuse me! Is there a post office around ______ I can have these posters sent to my friends?”

A.that

B.which

C.what

D.where

题型:填空题

下列关于古代书法的表述正确的是()。

A.王献之的《兰亭集序》是行书代表作

B.北宋时期宋徽宗赵佶创立了 “庾金体”

C.“柳骨颜筋”指柳永书法遒健,颜真卿书法端庄

D.唐朝的张旭和怀素的书法都是以隶书闻名于世

题型:填空题

在汇款的当事人中,汇款人和汇出行之间是哪种关系?()

A、债权债务关系

B、委托与被委托关系

C、委托代理关系

D、账户往来关系

题型:填空题

双杆立好后,迈步偏差不应大于()mm。

A.30

B.50

C.100

D.150

更多题库