天堂888-欧美黄色小说-熟睡侵犯の奶水授乳在线-初尝情欲h名器av-亚洲天堂免费视频-日韩五十路-免费在线国产-国产又大又黄又粗-久草导航-色播导航-亚洲免费资源-熟女一区二区三区视频-亚洲美女视频在线-亚洲成人福利视频-婷婷精品在线-亚洲综合p-中文字幕 日本-亚洲骚片-亚洲自拍偷拍网-国产农村妇女精品一区二区-午夜中出-久久精品国产精品亚洲毛片-91精品毛片-99爱视频在线-狠狠操亚洲-美女让人操-里番本子纯肉侵犯肉全彩无码-999偷拍

2016年下半年軟件設計師考試真題之下午題(3)

軟件設計師 責任編輯:木木 2016-11-24

添加老師微信

備考咨詢

加我微信

摘要:2016年下半年軟件設計師考試下午真題第三部分。

       >>>【希賽】2016年下半年軟考分數早知道,希賽網解析真題


       軟考歷年真題是考生備考的法寶,希賽軟考網整理了2016年下半年軟件設計師考試真題之下午題,供大家參考學習。以下為2016年下半年軟件設計師下午真題第三部分。


       試題五(共15分)

       閱讀下列說明和C++-代碼,將應填入(n)處的字句寫在答題紙的對應欄內。

       【說明】

       某發票(lnvoice)由抬頭(Head)部分、正文部分和腳注(Foot)部分構成。現采用裝飾(Decorator)模式實現打印發票的功能,得到如圖5-1所示的類圖。

5軟設.png

       【C++代碼】

       #include<iostream>

       using namespace std;

       class invoice{

       public:

       (1){

       cout<<"This 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 printinvoice0{

       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(&t);

       HeadDecorator h(&f);

       H.printlnvoice();

       cout<<“_____”<<endl;

       FootDecorator a(NULL);

       HeadDecorator b((5));

       B.printinvoice();

       return 0;

       }

       程序的輸出結果為:

       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!


       試題六(共15分)

       閱讀下列說明和Java代碼,將應填入(n)處的字句寫在答題紙的對應欄內。

       【說明】

       某發票(lnvoice)由抬頭(Head)部分、正文部分和腳注(Foot)部分構成。現采用裝飾(Decorator)模式實現打印發票的功能,得到如圖6-1所示的類圖。

6軟設.png

       【java代碼】

       class invoice{

       public void printInvoice(){:

       System.out.println("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 FootDecorator extends Decorator{

       public FootDecorator(lnvoice t){

       super(t);

       }

       public void printinvoice(){

       Systent.out.println("This is the header of the invoice!");

       (2);

       }

       }

       class FootDecorator extends Decorator{

       public FootDecorator(invoice t):{

       super(t);

       }

       public void printlnvoice(){

       (3);

       Systent.out.println("This is the header of the invoice!");

       }

       }

       Class test{

       public static void main(string[]args){

       Invoice t=new invioce();

       Invoice ticket;

       Ticket=(4);

       Ticket.Printinvoice();

       Systent.out.println(“--------------“)

       Ticket=(5);

       Ticket.Printinvoice();

       }

       }

       程序的輸出結果為:

       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!


       >>>返回目錄:2016年下半年軟件設計師考試真題(下午題)

       >>>2016年下半年軟件設計師考試下午真題答案與解析


       相關推薦:

       軟件設計師考試歷年真題答案與解析

       2017年軟件設計師考試輔導教材推薦

       軟件設計師考試培訓視頻教程

軟考不知道考啥科目?掃碼測最適合你的報考科目

企業微信截圖_1770345743610.png

通關資源:軟考各科歷年真題各科學習資料匯總  |  在線試題庫【點擊刷題】

免費課程:系統架構設計師報考指南2026年高項備考指導課及精講試聽  

熱門活動: 新年新起點,大額滿減有驚喜hotgif.gif

更多資料
更多課程
更多真題
溫馨提示:因考試政策、內容不斷變化與調整,本網站提供的以上信息僅供參考,如有異議,請考生以權威部門公布的內容為準!

軟考備考資料免費領取

去領取

!
咨詢在線老師!