皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
定义了抽象类point和它的派生类line,但它们的定义并不完整。请按要求完成下列操作,将程序补充完整。 (1)定义类point的构造函数,函数含参数i和j,它们都是int型数据,默认值都是0,用i和j分别将point的数据成员x0和y0初始化。请在注释"//**1**"之后添加适当的语句; (2)完成类point 的成员函数纯虚函数void set()和void draw()的定义,请在注释"//**2**"之后添加适当的语句; (3)添加类line的构造函数,函数含参数i、j、m和n,它们都是int型数据,默认值都是0,用i和j分别将point的数据成员x0和y0初始化。请在注释"//**3**"之后添加适当的语句。 输出结果如下: line::set() called. 源程序清单如下: using namespace std; #include class point { public: //**1** (1)定义类point的构造函数,函数含参数i和j,它们都是int型数据,默认值都是0,用i和j分别将point的数据成员x0和y0初始化。 //**2**(2)完成类point 的成员函数纯虚函数void set()和void draw()的定义 protected: int x0, y0; }; class line : public point { public: //**3** (3)添加类line的构造函数,函数含参数i、j、m和n,它们都是int型数据,默认值都是0,用i和j分别将point的数据成员x0和y0初始化。 { x1 = m; y1 = n; } void set() { cout << "line::set() called.\n"; } void draw() { cout << "line::draw() called.\n"; } protected: int x1, y1; }; void main() { line *lineobj = new line; lineobj->set(); }
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【简答题】加氯(氨)间应尽量靠近()。 A.值班室 D.氯库 C.清水池 D.投加点
【简答题】Translate the following sentences into English, using words in the brackets. 1. 他在赞扬互联网的长处。(virtue) 2. 我们必须乐观地面对未来。(confront) 3. 她惯于用尖酸刻薄语言挖苦人。(given) 4. 莎士比亚的抒情诗激发了听众的想像力。(exalt)
【判断题】Dispatch Department is responsible for sending orders on a particular day.
A.
正确
B.
错误
【单选题】Which department is reponsible for the consumers' complaints?
A.
Dispatch
B.
Marketing
C.
After sales
D.
IT
【单选题】Special instructions have been given to our dispatch department to send your orders on February 1 and March 15 separately,as ____ in your letter of January 15.
A.
ordered
B.
was written
C.
specified
D.
wished
【简答题】I checked the files and ________________________________(发现了问题的原因). An error on our computer records showed your account to be in arrears. For this reason the Dispatch Department did not send out your...
【简答题】莎士比亚的抒情诗激发了听众的想像力。(inspire)
【单选题】● Look at the organization plan below. ● For questions 6—10, which department (A-H) does this job? ● For each question, mark the correct letter (A—H) on your Answer Sheet. ● Do not use any letter more...
A.
Department of production E. Department of purchasing
B.
Department of marketing F. Department of research and development
C.
Department of public relations G. Department of accounts
D.
Department of dispatch H. Department of personnel Which department deals with customers with problem?
【简答题】莎士比亚的抒情诗激发了听众的想像力。(exalt)
【简答题】他在赞扬互联网的长处。(virtue) 我们必须乐观地面对未来。(confront) 她惯于用尖酸刻薄语言挖苦人。(given) 莎士比亚的抒情诗激发了听众的想像力。(exalt)
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题