单选题The base of a rectangle is two times as long as the height. If the perimeter is 42, what is the area of the rectangle?A 36B 42C 98D 196E 218

题目
单选题
The base of a rectangle is two times as long as the height. If the perimeter is 42, what is the area of the rectangle?
A

36

B

42

C

98

D

196

E

218


相似考题

3.使用VC6打开考生文件夹下的工程test41_3。此工程包含一个test41_3.cpp,其中定义了类Rectangle,但该类的定义并不完整。请按要求完成下列操作,将程序补充完整。(1)定义类Rectangle的私有数据成员left,top和fight,bottom,它们都是int型的数据。请在注释“//**1**”之后添加适当的语句。(2)添加类Rectangle的带四个int型参数1、t、r、b的构造函数的声明,并使这四个参数的默认值均为0,请在注释“//**2**”之后添加适当的语句。(3)添加类Rectangle的成员函数SetTop()参数为int型的t,作用为把t的值赋给类的数据成员top,添加类Rectangle的成员函数SetBottom()参数为int型的t,作用为把t的值赋给类的数据成员bottom,请在注释“//**3**”之后添加适当的语句。(4)完成派生类Rectangle的成员函数Show()的定义,使其以格式“right-bottom point is(right,bottom)”输出,请在注释“//**4**”之后添加适当的语句。源程序文件test41_3.cpp清单如下:include <iostream.h>class Rectangle{// ** 1 **int right, bottom;public:// ** 2 **~ Rectangle(){};void Assign(int 1, int t, int r, int b);void SetLeft(int t){left = t;}void SetRight(int t){right = t;}// ** 3 **void SetBottom(int t){bottom = t;}void Show();};Rectangle::Rectangle(int 1, int t, int r, int b){left = 1; top = t;right = r; bottom = b;}void Rectangle::Assign(int 1, int t, int r, int b){left = 1; top = t;right = r; bottom = b;}void Rectangle::Show(){cout<<"left-top point is ("<<left<<","<<top<<")"<<'\n';// ** 4 **}void main(){Rectangle rect;rect.Show();rect.Assign(100,200,300,400);rect.Show();}

更多“单选题The base of a rectangle is two times as long as the height. If the perimeter is 42, what is the area of the rectangle?A 36B 42C 98D 196E 218”相关问题
  • 第1题:

    下面程序段中,说法正确的是( ) 。class location{ public : int GetX(); }; class rectangle:private location { public: int GetW(); };

    A.类rectangle的私有派生类是location

    B.类rectangle中的public成员在类location中是私有的

    C.类location中的public成员在类rectangle中是不可访问的

    D.viodf(){Rectangler;intX=r.GetX();}其中intX=r.GetX();是非法语句


    正确答案:D

  • 第2题:

    下列程序的执行结果为【 】。include class Point{public:Point(double i, double j)

    下列程序的执行结果为【 】。

    include <iostream. h>

    class Point

    {

    public:

    Point(double i, double j) { x=i; y=j;}

    double Area() const { return 0.0;}

    private:

    double x, y;

    };

    class Rectangle: public Point

    {

    public:

    Rectangle(double i, double j, double k, double 1)

    double Area() const {return w * h;}

    private:

    double w, h;

    };

    Rectangle: :Rectangle(double i, double j, double k. double 1): Point(i,j).

    {

    w=k, h=1

    }

    void fun(Point &s)

    {

    cout<<s. Area()<<end1;

    }

    void main( )

    {

    Rectangle rec(3.0, 5.2, 15.0. 25.0);

    fun(rec)

    }


    正确答案:×
    0 解析:注意本题不同于基类的指针指向派生类对象。Fun函数的形参是Point基类的引用。在可以用基类对象的地方,均可以用派生类替代,完成基类的行为。反之,在使用派生类对象的地方却不能用基类对象代替,这是因为派生类中的某些行为在基类对象中是不存在的。本题调用的是Point类对象的面积函数,其值永远为0。

  • 第3题:



    A. Shape
    B. Drawing
    C. Rectangle
    D. V2Drawing

    答案:A
    解析:
    桥接模式将抽象部分与它的实现部分分离,使它们都可以独立地变化。它是一种对象结构型模式,又称为柄体(Handle and Body)模式或接口(Interface)模式。桥接模式类似于多重继承方案,但是多重继承方案往往违背了类的单一职责原则,其复用性比较差,桥接模式是比多重继承方案更好的解决方法。·Abstraction定义抽象类的接口;维护一个指向Implementor类型对象的指针。 ·RefinedAbstraction扩充由Abstraction定义的接口。 ·Implementor定义实现类的接口,该接口不一定要与Abstraction的接口完全一致;事实上这两个接口可以完全不同。一般来说,Implementor接口仅提供基本操作,而Abstraction则定义了基于这些基本操作的较高层次的操作。 ·ConcreteImplementor实现Implementor接口并定义它的具体实现。图中与Bridge模式中的“Abstraction”角色相对应的类是Shape,与“Implementor”角色相对应的类是Drawing。

  • 第4题:

    吸收塔每层喷淋的喷嘴有()个。

    • A、36
    • B、42
    • C、48
    • D、52

    正确答案:D

  • 第5题:

    人体安全电压最高是()V。

    • A、36
    • B、42
    • C、220

    正确答案:B

  • 第6题:

    按住Ctrl键Rectangle可以画()。

    • A、矩形

    正确答案:B

  • 第7题:

    进行汽车二级维护前,检测分电器的触点闭合角应为()°。

    • A、30~36
    • B、36~42
    • C、42~48
    • D、48~54

    正确答案:B

  • 第8题:

    单选题
    If the area of a square with sides of length 8 centimeters is equal to the area of a rectangle with a width of 4 centimeters, what is the length of the rectangle, in centimeters?
    A

    4

    B

    8

    C

    12

    D

    16

    E

    18


    正确答案: A
    解析:
    设长方形长为x,故4x=8×8,x=16,故本题选D项。

  • 第9题:

    单选题
    If one pair of opposite sides of a square are increased in length by 20% and the other pair of sides are increased in length by 50%, by what percent is the area of the rectangle that results greater than the area of the original square?
    A

    10%

    B

    50%

    C

    70%

    D

    75%

    E

    80%


    正确答案: E
    解析:
    Suppose the length of a side of the original square is 10; then the area of that square is 10×10 or 100. Since one pair of opposite sides of the square are increased in length by 20%, and 20% of 10 is 2, the length of that pair of opposite sides of the new rectangle is 10+2 or 12. Since the other pair of sides are increased in length by 50%, and 50% of 10 is 5, the length of the other pair of opposite sides of the new rectangle is 10+5 or 15. The area of the new rectangle formed is 12×15 or 180, which is 80% greater than 100, the area of the original square.

  • 第10题:

    单选题
    A white buoy with an orange rectangle on it displays().
    A

    directions

    B

    dangers

    C

    exclusion areas

    D

    All of the above


    正确答案: B
    解析: 暂无解析

  • 第11题:

    单选题
    Which statements concerning the effect of the statement gfx.drawRect(5, 5, 10, 10) are true, given that gfx is a reference to a valid Graphics object?()
    A

    The rectangle drawn will have a total width of 5 pixels.

    B

    The rectangle drawn will have a total height of 6 pixels.

    C

    The rectangle drawn will have a total width of 10 pixels.

    D

    The rectangle drawn will have a total height of 11 pixels.


    正确答案: D
    解析: 暂无解析

  • 第12题:

    问答题
    A rectangle is equal in area to a square with sides of length 12. Is the diagonal of the rectangle greater in length than 20?  (1) The rectangle has a length of 16.  (2) The rectangle has a width of 9.

    正确答案: D
    解析:
    通过计算可知,若长方形长为16或宽为9,面积为144,其对角线长度均小于20,故本题选D项。

  • 第13题:

    阅读以下说明和C++代码,填入(n)处。

    [说明]

    以下C++代码使用虚函数实现了同一基类shape派生出来的Class rectangle、Class triangle、Class circle实现了计算矩形、圆形面积的计算。仔细阅读以下代码,将(n)处语句补充完整。

    [代码5-1]

    include<iostream.h>

    define PI 3.14159

    class shape {//基类

    protected:

    (1);

    public:

    (2);

    (3);

    };

    [代码5-2]

    class rectangle: public shape {

    public:

    rectangle (int x2,int y2,int r2): (4) {};

    double area ( ) {return x*y; };

    };

    class circle: public shape {

    public:

    circle (int x3,int y3,int r3):(5){};

    double area ( ) {return r*r*PI; };

    };

    [代码5-3]

    void main ( )

    {

    rectangle r (10,20,0);

    circle c (0,0,30);

    shape (6);

    cout<<"长方形面积="<<s1->area ( ) <<endl;

    cout<<"圆形面积="<<s2->area ( ) <<endl;

    }

    [运行结果]

    长方形面积=200

    圆形面积=2827.43


    正确答案:(1)intxyr; (2)shape(int x1int y1int r1): x(x1)y(y1)r(r1){}; (3)double virtual area()=0; (4)shape(x2y2r2) (5)shape(x3y3r3) (6)*s1=&r*s2=&c;
    (1)intx,y,r; (2)shape(int x1,int y1,int r1): x(x1),y(y1),r(r1){}; (3)double virtual area()=0; (4)shape(x2,y2,r2) (5)shape(x3,y3,r3) (6)*s1=&r,*s2=&c; 解析:本题C++代码使用虚函数用同一基类shape派生出来的Class rectangle、Class triangle、Class circle实现了计算矩形、圆形面积的计算。各空实现的功能是:(1)x,y存储长与宽,r存储半径;(2)构造函数;(3)面积虚函数,旨在定义不同面积公式;(4)构造函数;(5)构造函数;(6)类变量定义,根据下文用到的变量可推知。

  • 第14题:

    使用VC6打开考生文件夹下的工程test1_1,此工程包含一个源程序文件test1_1.cpp,但该程序运行有问题,请改正main函数中的错误,使该程序的输出结果如下:

    Constructor called.

    Default constructor called.

    Area is 6

    Area is 0

    Area is 6

    源程序文件test1_1,cpp清单如下:

    include<iostream.h>

    class RectAngle

    {

    private:

    double ledge,sedge;

    public:

    RectAngle()

    {

    cout<<"Default constructor called.";

    }

    RectAngle(double l,double s)

    {

    ledge=l;sedge=s;

    cout<<"Constructor called.";

    }

    void Set(double l,double s)

    {

    ledge=l;sedge=s;

    }

    void Area()

    {

    cout<<"Area is"<<ledge*sedge<<endl;

    }

    };

    void main()

    {

    /***************** found *****************/

    RectAngle Rect1(2,3);

    RectAngle Rect2(1);

    /**************** found *****************/

    RectAnglC Rect3;

    Rectl.Area();

    /***************** found *****************/

    RecL2.lodge=0;Rect2.sedge=0;

    Reck2.Area();

    Rect3.Area();

    }


    正确答案:(1)错误:Rect2(1) 正确:Rect2 (2)错误:Rect3 正确:Rect3(Rect1) (3)错误:Rect2.1edge=0;Rect2.sedge=0; 正确:Rect2.Set(00);
    (1)错误:Rect2(1) 正确:Rect2 (2)错误:Rect3 正确:Rect3(Rect1) (3)错误:Rect2.1edge=0;Rect2.sedge=0; 正确:Rect2.Set(0,0); 解析:(1)主要考查考生对于重载构造函数调用的理解,Rect2应该调用缺省构造函数,这里重载的构造函数是以参数个数不同区分的;一个是缺省的构造函数,即没有参数的;另一个含有两个参数,为了能使“Default constructor called.”输出,应该调用不含有参数的缺省构造函数;
    (2)主要考查考生是否会使用缺省的拷贝初始化构造函数,这是不出现构造函数被调用语句的惟一方法,不管使用缺省的构造函数还是含有两个参数的构造函数都会在屏幕上出现多余的文字,而这些文字只有使用在类中没有被定义的缺省拷贝初始化构造函数来声明一个新的对象才不会出现,根据提示应该使用Rect1这个已有的对象去初始化Rect3R个新的对象,这就是拷贝初始化构造函数的作用,即使用已有的或者已存在的对象去初始化一个新的对象;
    (3)主要考查考生对于类的对象访问权限的掌握,ledge和sedge为类的私有成员,不能被类的对象Rect2访问,应使用成员函数Set()。

  • 第15题:



    A. Shape
    B. Drawing
    C. Rectangle
    D. V2Drawing

    答案:B
    解析:
    桥接模式将抽象部分与它的实现部分分离,使它们都可以独立地变化。它是一种对象结构型模式,又称为柄体(Handle and Body)模式或接口(Interface)模式。桥接模式类似于多重继承方案,但是多重继承方案往往违背了类的单一职责原则,其复用性比较差,桥接模式是比多重继承方案更好的解决方法。·Abstraction定义抽象类的接口;维护一个指向Implementor类型对象的指针。 ·RefinedAbstraction扩充由Abstraction定义的接口。 ·Implementor定义实现类的接口,该接口不一定要与Abstraction的接口完全一致;事实上这两个接口可以完全不同。一般来说,Implementor接口仅提供基本操作,而Abstraction则定义了基于这些基本操作的较高层次的操作。 ·ConcreteImplementor实现Implementor接口并定义它的具体实现。图中与Bridge模式中的“Abstraction”角色相对应的类是Shape,与“Implementor”角色相对应的类是Drawing。

  • 第16题:

    AutoCAD中设置图幅用()命令。

    • A、NEW
    • B、LIMITS
    • C、EXTEND
    • D、RECTANGLE

    正确答案:B

  • 第17题:

    我国规定的安全电压是指不大于()V的电压。

    • A、36
    • B、42
    • C、24

    正确答案:B

  • 第18题:

    Which statements concerning the effect of the statement gfx.drawRect(5, 5, 10, 10) are true, given that gfx is a reference to a valid Graphics object?()  

    • A、The rectangle drawn will have a total width of 5 pixels.
    • B、The rectangle drawn will have a total height of 6 pixels.
    • C、The rectangle drawn will have a total width of 10 pixels.
    • D、The rectangle drawn will have a total height of 11 pixels.

    正确答案:D

  • 第19题:

    我国规定安全电压是()V。

    • A、36
    • B、42
    • C、12
    • D、24

    正确答案:B

  • 第20题:

    单选题
    关于图3.19的叙述()是不正确的。
    A

    Rectangle类和Circle类都有名为area的属性,这两个属性一定是相同的属性

    B

    Rectangle类和Circle类都有名为getArea的操作,这两个操作一定是相同的操作

    C

    Rectangle中名为length的属性和Circle类中名为radius的属性,这两个属性一定是不同的属性

    D

    Shape类有一个属性,Circle类有两个属性,Rectangle类有三个属性


    正确答案: C
    解析: 在父类与子类的继承关系中,多态这种方法使得在多个子类中可以定义同一个操作或属性名,并在每个子类中可以有不同的实现。Rectangle和Circle都继承于父类Shape,对于Shape而言,会有getArea()的操作。但是子类Rectangle和Circle的getArea方法的实现可以完全不一样的,这就体现了多态的特征。至于选项D://Circle类和Rectangle类都要从Shape类继承一个属性,因此分别有"1+1=2"个属性和"2+1=3"个属性。

  • 第21题:

    单选题
    The length of a rectangle is 5 more than the side of a square, and the width of the rectangle is 5 less than the side of the square. If the area of the square is 45, what is the area of the rectangle?
    A

    20

    B

    25

    C

    45

    D

    50

    E

    70


    正确答案: D
    解析:
    设正方形的边长为x,那么根据题意有x2=45,所以矩形的面积为 (x+5)(x-5) =x2-25=45-25=20。

  • 第22题:

    单选题
    The base of a rectangle is two times as long as the height. If the perimeter is 42, what is the area of the rectangle?
    A

    36

    B

    42

    C

    98

    D

    196

    E

    218


    正确答案: D
    解析:
    If h represents the height, then the base is 2h. Since Perimeter=42=2(h+2h), hence h=7 and base=14. So Area=7×14=98.

  • 第23题:

    单选题
    What is the circumference of a circle in which a 5 by 12 rectangle is inscribed?
    A

    13n

    B

    17n

    C

    26n

    D

    34n

    E

    60n


    正确答案: C
    解析:
    The length of a diagonal of a 5 by 12 rectangle is 13 since, when a diagonal is drawn, the lengths of the sides of the right triangle that results form a (5,12,13) Pythagorean triple with 13 as the hypotenuse. If this rectangle is inscribed in a circle, the diagonals of the rectangle are diameters of the circle, so the length of a diameter of the circle is 13. The circumference of a circle with diameter 13 is 13π.

  • 第24题:

    单选题
    An orange and white buoy with a rectangle on it displays().
    A

    directions

    B

    distances

    C

    locations

    D

    All of the above


    正确答案: D
    解析: 暂无解析