下述程序中语句完全不正确的一组语句是()

5 查阅

下述程序中语句完全不正确的一组语句是()

classautomover{

intwheels;floatweight;public:

voidinitialize(int,float);intget_wheels();floatget_weight(){returnweight;}

};voidautomover::initialize(intin_wheels,floatin_weight)

{wheels=in_wheels;weight=in_weight;}

intautomover::get_wheels(void){returnwheels;}

voidmain()

{automovercar;automover.initialize(4,3000.0);//①

car.wheels=4;//②

car.weight=3000.0;//③

car.initialize(4,3000.0);//④

cout<<"Thecarhas"<<car.wheels<<"wheels.";//⑤

cout<<"Thecarweighs"<<car.weight<<"pounds.";//⑥

cout<<"Thecarhas"<<car.get_wheels()<<"wheels.";//⑦

cout<<"Thecarweighs"<<car.get_weight()<<"pounds.";//⑧

A.①、②、③、④、⑤

B.①、②、③、⑤、⑥

C.②、③、④、⑤、⑥

D.①、②、④、⑦、⑧

参考答案:

答案:①、②、③、⑤、⑥