网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
有下列程序:includeUsing namespace std;Class Amount{ int amount;public; Amount(i
有下列程序: #include<iostream> Using namespace std; Class Amount{ int amount; public; Amount(int n=O):amount(n){} Int getAmount()const{return amount;} Amount &operator+=(AmountA) {
A.*this
B.this
C.&amount
D.amount
参考答案
更多 “ 有下列程序:includeUsing namespace std;Class Amount{ int amount;public; Amount(i 有下列程序: #include<iostream> Using namespace std; Class Amount{ int amount; public; Amount(int n=O):amount(n){} Int getAmount()const{return amount;} Amount operator+=(AmountA) {A.*thisB.thisC.amountD.amount ” 相关考题
考题
有如下程序:includeusing namespace std;class Amount{int amount;public:Amount(int
有如下程序: #include<iostream> using namespace std; class Amount{ int amount; public: Amount(int n=0):amount(n){ } int getAmount( )const{return amount;} Amountoperator+=(Amount A) { amount+=a.amount; return; } }; int main( ){ Amount x(3),y(7); x+=y: cout<<x.getAmount( )<<endl; return 0; } 已知程序的运行结果是10,则下画线处缺失的表达式是A.*thisB.thisC.amountD.amount
考题
有如下类的声明: class Base{ protected: int amount; public: Base(int n=0):amount(n){} int getAmount()const{return amount;} }; class Derived:public Base{ protected: int value public: Derived(int m,int n):value(m),Base(n){} int getData()const{return value+amount;} };已知x是一个Derived对象,则下列表达式中正确的是A.x. value+x. getAmount()B.x. getData()-x. getAmount()C.x. getData()-x. amountD.x. value+x. amount
考题
有如下程序: include using namespace std; class Amount{ int amount
有如下程序: #include<iostream> using namespace std; class Amount{ int amount; public: Amount(int n=0):amount(n){} int getAmount()const{return amount;} Amountoperator9=(Amount a){ amount+=a. amount; return______; } }; int main(){ Amount x(3),y(7); x+=y, cout<<x. getAmount()<<endl; return 0; }已知程序的运行结果是10,则下划线处缺失的表达式是A.* thisB.thisC.amountD.amount
考题
有如下类声明: class Base{ protected: int amount; public: Base(int n=0):amount(n){} int getAmountconst{retum amount;} }; class Derived:public Base{ protected: int value; public: Derived(int m,int n):value(m),Base(n){} int getDataconst{return value+amount;} }: 已知x是一个Derived对象,则下列表达式中正确的是( )。A.x.value+X.getAmountB.x.getData一x.getAmountC.x.getData一x.amountD.x.value+X.amount
考题
阅读下列说明和C++代码,填写程序中的空(1)~(6),将解答写入答题纸的对应栏内。
【说明】
以下C++代码实现一个简单绘图工具,绘制不同形状以及不同颜色的图形。部分类及其关系如图6-1所示。
【C++代码】
#include?#include?using?namespace?std;class?DrawCircle?{??????//绘制圆形,抽象类? ? ? public: (1);//定义参数为?int?radius,?int?x,?inty? ?virtual~DrawCircle()?{?}};class?RedCircle:public?DrawCircle?{????//绘制红色圆形? ? ? ? public: void?drawCircle(intradius,?int?x,?int?y)?{cout??drawCircle?=?drawCircle;? }? ?virtual~shape()?{?}? public:? ?virtual?void?draw()?=?0;};class?Circle:public?Shape?{????//圆形? ? private:? ? ?int?x,y,radius;? ? public:? Circle(int?x,inty,int?radius,DrawCircle?*drawCircle)? (3)? {? this->x?=?x;? ?this->y?=?y;? ? this->radius?=?radius; }? ? ? public:? void?draw(){? drawCircle?-> (4); }};int?main(){Shape?*redCirclenew?Circle(100,100,10,????(5)????);//绘制红色圆形? Shape?*greenCircle=new?Circle(100,100,10, (6)??);//绘制绿色圆形redCircle >draw();? ?greenCircle?->draw();? ?return?0;}
考题
7、BookStore数据库中有销售明细表OrderDetail(OrderCode, BookCode, Amount) 查询销售总量前20%的图书,并按总销量降序排列。SQL语句: SELECT TOP 20 PERCENT Bookcode As 书号, SUM(Amount)As总销量 ROM OrderDetail GROUP BY Bookcode ORDER BY ________A.Amount DESCB.SUM(Amount) DESCC.COUNT(Amount) DESCD.ADD(Amount) DESC
考题
BookStore数据库中有销售明细表OrderDetail(OrderCode, BookCode, Amount) 查询销售总量前20%的图书,并按总销量降序排列。SQL语句: SELECT TOP 20 PERCENT Bookcode As 书号, SUM(Amount)As总销量 ROM OrderDetail GROUP BY Bookcode ORDER BY ________A.Amount DESCB.SUM(Amount) DESCC.COUNT(Amount) DESCD.ADD(Amount) DESC
考题
【单选题】BookStore数据库中有销售明细表OrderDetail(OrderCode, BookCode, Amount)查询销售总量前20%的图书,并按总销量降序排列。SQL语句: SELECT TOP 20 PERCENT Bookcode As 书号, SUM(Amount)As总销量 ROM OrderDetail GROUP BY Bookcode ORDER BY ________A.Amount DESCB.SUM(Amount) DESCC.COUNT(Amount) DESCD.ADD(Amount) DESC
考题
写出下面代码的运行结果。def addInterest(balance,rate): newBalance=balance*(1+rate) balance=newBalance def main(): amount=1000 rate=0.05 addInterest(amount,rate) print (amount) main()
热门标签
最新试卷