题目内容

请使用VC6或使用[答题]菜单打开考生文件夹proj1下的工程proj1。此工程中包括类Point、函数fun和主函数main。程序中位于每个“//ERROR ****found****”之后的一行语句有错误,请加以改正。改正后程序的输出结果应为: The point is(0,1) The point is(3,5) 注意:只修改每个“//ERROR ****found****”下的那一行,不要改动程序中的其他内容。 #include <iostream> using namespace std; class Point { public: // ERROR *********found********* Point(int x = 0, int y) : x_(x), y_(y) {} // ERROR ********* found********* void move(int xOff, int yOff) const { x_+ = xOff; y_+ = yOff; } void print() const { cout << "The point is (" << x_<<’,’<< y_<< ’)’<< endl; } private: int x_, y_; }; void fun (Point* p) { //ERROR ********* found********* p.print (); } int main () { Point p1, p2 (2, 1); p1.print (); p2.move (1, 4); fun (&p2); return 0; }

查看答案
更多问题

Eight badminton players were charged with trying to ______ the outcome of preliminary matches.

A. dominate
B. manipulate
C. eliminate
D. simulate

These researchers intend to ______ this research until there is some substantial finding.

A. insist on
B. call on
C. live on
D. carry on

Light levels are carefully controlled to fall within an acceptable level for ______ reading convenience.

A. intentional
B. ideal
C. obligatory
D. standard

Russia is ______ the largest country in the world, covering more than a ninth of the Earth"s land area.

A. far from
B. by far
C. at first
D. other than

答案查题题库