久久久国产精品秘人口麻豆|永久免费AV无语国产|人成电影免费中文字幕|久久AV嫩草影院2

    1. <dfn id="yitbn"><samp id="yitbn"><progress id="yitbn"></progress></samp></dfn>

          <div id="yitbn"></div>

          1. 首頁 - 網(wǎng)校 - 萬題庫 - 美好明天 - 直播 - 導航
            您現(xiàn)在的位置: 考試吧 > 自學考試 > 歷年真題 > 工學類 > 正文

            全國2010年10月高等教育C++程序設計自考試題

             

              42. #include < iostream, h >

              class test {

              private : int x, y;

              public : void testl ( int a, int b) { x = a ; y = b;}

              int max( );

              };

              int test:max( ) {if(x>y) return x;else return y;}

              void main( ){

              test a;

              a. testl ( 1,3);

              cout << a. max ( ) << endl;

              }

              43. #include < iostream, h >

              void main() {

              int x =5;

              const int * const p = &x;

              * p =88;

              cout << * p << endl;

              }

              44. #include < iostream, h >

              class point

              {

              private : float x, y ;

              public : f( float a, float b) { x = a ; y = b ; }

              f( ) {x=O;y=O;}

              void getx( ) { cout < < x < < endl; }

              void gety ( ) { cout < < y < < endl ; }

              }

              class pointl

              }

              private : float x, y ;

              public : f( float a, float b) { x = a; y = b ; }

              f( ){x=l;y=l;}

              void getx( ) {cout <

              void gety( ) {cout <

              };

              main( ) I

              point a;

              a.f();

              a. getx( ) ;a. gety ( );

              }

              45. #include < iostream, h >

              void main( ) {

              string strl (" we are here" );

              cout << strl << endl;

              }

              四、完成程序題(本大題共5小題,每題4分,共20分)

              46.在下面程序的下劃線處填上正確的數(shù)據(jù)類型,保證程序具有如下輸出結果:

              0

              17

              17,17,17

              源程序如下:

              #include < iostream >

              using namespace std;

              class base

              {

              public :

              ______________num;

              base ( ) { }

              };

              int base::hum = 0;

              void main( )

              {

              cout << base::num << endl;

              _________________* p=&base : :num;

              *p=17;

              cout << base::num << end1;

              base a,b;

              cout << * p<<"," << a. hum << "," <

              47.在下面橫線處填上正確的內(nèi)容,完成類的定義。

              class Base

              {

              int x;

              static const int b;

              public:

              Base( int, int);

              const int &a;

              };

              ______________b =15;

              Base::Base(int i,int j): ___________{ }

              48.完成下面程序中的show函數(shù)的定義,使其運行結果如下:

              In base

              In derived

              程序清單如下:

              #include

              using namespace std;

              class base

              {

              pubhc :

              virtual void print( )

              {

              cout << "In base" << endl;

              }

              };

              class derived: public base

              {

              public :

              void print( ) { cout << "In derived" << endl; }

              };

              void show(base * pb,void (base:: * pf) ( ) )

              {

              _________

              }

              void main( )

              {

              base b;

              derived d ;

              show ( &b, base::print);

              show ( &d, base::print);

              }

            上一頁  1 2 3 4 5 6 下一頁
              編輯推薦:

              2010年10月自考試題及答案發(fā)布專題

              各地2010年10月自考成績查詢時間及查詢方式匯總

              考試吧策劃:2011年自學考試報考完全指南
            文章搜索
            萬題庫小程序
            萬題庫小程序
            ·章節(jié)視頻 ·章節(jié)練習
            ·免費真題 ·?荚囶}
            微信掃碼,立即獲取!
            掃碼免費使用
            大學語文
            共計461課時
            講義已上傳
            18020人在學
            管理系統(tǒng)中計算機應用
            共計21課時
            講義已上傳
            7218人在學
            政治經(jīng)濟學(財經(jīng)類)
            共計738課時
            講義已上傳
            87485人在學
            經(jīng)濟法概論(財經(jīng)類)
            共計21課時
            講義已上傳
            989人在學
            毛概
            共計269課時
            講義已上傳
            16493人在學
            推薦使用萬題庫APP學習
            掃一掃,下載萬題庫
            手機學習,復習效率提升50%!
            版權聲明:如果自學考試網(wǎng)所轉載內(nèi)容不慎侵犯了您的權益,請與我們聯(lián)系800@eeeigo.com,我們將會及時處理。如轉載本自學考試網(wǎng)內(nèi)容,請注明出處。
            官方
            微信
            掃描關注自考微信
            領《大數(shù)據(jù)寶典》
            報名
            查分
            掃描二維碼
            關注自考報名查分
            看直播 下載
            APP
            下載萬題庫
            領精選6套卷
            萬題庫
            微信小程序
            幫助
            中心
            文章責編:wbian