单项选择题
A.from
B.at
C.out of
D.into
A.from
B.at
C.out
B.into
点击查看答案
<上一题
目录
下一题>
热门
试题
未分类题
阅读以下说明和C++代码(代码13-1),将应填入(n)处的字句写在对应栏内。【说明】软件设计师东方飞龙利用UML设计了一个迷你小型复数类,其类图如图13-11所示。 【代码13-l】 *___________________________________* ********* 文件 MiniComplex. h********* *___________________________________* include<iostream> using namespace std; class MiniComplex {(1): 重载流插入和提取运算符 (2) ostream & operator <<(ostream & osObject, const MiniComplex & complex) { osObject <<'('<<complex. realPart<<'+'<<complex. imagPart <<'I'<<')'; return osObject; } friend (3) operator >>(istream & isObject, MiniComplex & complex) { char ch; isObject >>complex. realPart >>ch>>complex. imagPart >>ch; return isObject; } MiniComplex(double real=0, double imag=0); 构造函数 MiniComplex operator+(const MiniComplex & otherComplex)const! 重载运算符+ MiniComplex operator--(const MiniComplex & otherComplex)const! 重载运算符- MiniComplex operator*(const MiniComplex& othmComplex)const; 重载运算符* MiniComplex operator (const MiniComplex & otherComplex)const; 重载运算符 bool perator==(const MiniComplex &otherComplex)const; 重载运算符== private: double realPart; 存储实部变量 double imagPart; 存储虚部变量 }; *_______________________________________________________* * * * * * * * * *文件 MiniComplex. cpp* * * * * * * * * * *_______________________________________________________* include 'MiniComplex.h' bool MiniComplex:: perator==(const MiniComplex & otherComplex)const { (1);} MiniComplex:: MiniComplex(double real, double imag){realPart=real;imagPart=imag!} MiniComplex MiniComplex:: operator+(const MiniComplex & otherComplex)const { MiniComplex temp; temp. realPart=realPart+ otherComplex. realPart; temp. imagPart=imagPart+ otherComplex. imagPart; return temp; } MiniComplex MiniComplex::operator--(const MiniComplex & otherComplex)const { MiniComplex temp; temp.realPart=realPart-otherComplex.realPart; temp. imagPart=imagPart-otherCompler.imagPart; return temp; } MiniComplex MiniComplex:: operator*(const MiniComplex& otherComplex)const { MiniComplex temp; temp.realPart=(realPart* otherComplex.realPart)-(imag-Part* otherComplex.imag-Part); temp imagPart=(realPart* otherComplex. imagPart)+(imag-Part *otherComplex.realPart); return temp, } MiniComplex MiniComplex:: operator (const MiniComplex& otherComplex)eonst { MiniComplex temp; float tt; tt=1 (otherComplex. realPart *otherComplex. realPart+otherComplex. imagPart* other Complex.imagPart); temp. realPart=((realPart* otherComplex.realPart)+(imagPart* otherComplex.imagPart))*tt; temp. imagPart=((imagPart * otherComplex.realPart)-(realPart* otherComplex.imagPart))*tt;<
点击查看答案
单项选择题
计算机能直接执行的程序是()
A.源程序
B.目标程序
C.汇编程序
D.可执行程序
点击查看答案&解析
相关试题
当使用魔棒工具选择图像时,在“容差”数值...
在拼合图层时,会将暂不显示的图层全部删除...
显示与隐藏参考线快捷键是Ctrl+H()
采用该战略有可能面临哪些障碍?如何解决?
From this passage we can learn tha...