上機部分
一、改錯題
使用VC6打開考生文件夾下的工程kt4_1,此工程包含一個源程序文件kt4_1.cpp,但該程序運行有問題,請改正程序中的錯誤,使程序的輸出結(jié)果如下:
1:
weight:5
age:0
2:
weight:7
age:9
源程序文件kt4_1.cpp清單如下:
#include
classanimal
{
public:
/****************found*******************/
friendvoidsetvalue(animal&,int);
/****************found*******************/
viodprint();
protected:
intitsweight;
intitsage;
};
voidanimal::print()
{
cout<<"weight:"<
cout<<"age:"<
}
voidsetvalue(animal&ta,inttw)
{
ta.itsweight=tw;
ta.itsage=0;
}
上一頁 1 2 3 4 5 6 7 8 9 10 ...
下一頁 >> 相關(guān)推薦:2010年9月計算機等級考試精華備考資料匯總
計算機等級考試二級VB上機試題及答案匯總
計算機等級考試二級VB模擬試題及答案匯總