freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

最新下半軟件設(shè)計師考試下午真題試題及參考答案(編輯修改稿)

2025-07-22 00:57 本頁面
 

【文章內(nèi)容簡介】 5.閱讀下列說明和C++代碼,將應(yīng)填入 (n) 處的字句寫在答題紙的對應(yīng)欄內(nèi)?!菊f明】 某發(fā)票(lnvoice)由抬頭(Head)部分、正文部分和腳注(Foot)部分構(gòu)成?,F(xiàn)采用裝飾( Decorator)模式實現(xiàn)打印發(fā)票的功能,得到如圖51所示的類圖。【C++代碼】include iostreamusing namespace std。class Invoice{public: (1) { coutThis is the content of the invoice!endl。 }}。class Decorator : public Invoice { Invoice *ticket。public: Decorator(lnvoice *t) { ticket = t。 } void printInvoice(){ if(ticket != NULL) (2)。 } }。class HeadDecorator : public Decorator{public: HeadDecorator(lnvoice*t): Decorator(t) { } void printInvoice() { cout This is the header of the invoice! endl。 (3) 。 } }。 class FootDecorator : public Decorator{ public: FootDecorator(Invoice *t): Decorator(t) { } void printlnvoice(){ (4) 。 cout This is the footnote of the invoice! endl。 }}。int main(void) { Invoice t。 FootDecorator f(amp。t)。 HeadDecorator h(amp。f)。 ()。 cout””endl。 FootDecorator a(NULL) 。 HeadDecorator b( (5) )。 ()。 return 0。}程序的輸出結(jié)果為: This is the header of the invoice! This is the content of the invoice! This is the footnote of the invoice! This is the header of the invoice! This is the footnote of the invoice!6.閱讀下列說明和java代碼,將應(yīng)填入 (n) 處的字句寫在答題紙的對應(yīng)欄內(nèi)?!菊f明】 某發(fā)票(lnvoice)由抬頭(Head)部分、正文部分和腳注(Foot)部分構(gòu)成?,F(xiàn)采用裝飾(Decorator)模式實現(xiàn)打印發(fā)票的功能,得到如圖61所示的類圖。【java代碼】class invoice{public void printInvoice(){ ( This is the content of the invoice!)。 }}class Decorator extends Invoice { protected Invoice ticket。 public Decorator(lnvoice t){ ticket = t。} public void printInvoice(){ if(ticket != null) (1) 。 } }class HeadDecorator extends Decorator{ public HeadDecorator(lnvoice t){ super(t)。} public void printInvoice (){ ( This is the header of the invoice! )。 (2) 。 }} class FootDecorator e
點擊復制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1