niusouti.com

单选题Circles O and P intersect at exactly one point, as shown in the figure above. If the radius of circle O is 2 and the radius of circle P is 6, what is the circumference of any circle that has OP as a diameter?A 4πB 8πC 12πD 16πE 64π

题目
单选题
Circles O and P intersect at exactly one point, as shown in the figure above. If the radius of circle O is 2 and the radius of circle P is 6, what is the circumference of any circle that has OP as a diameter?
A

B

C

12π

D

16π

E

64π


相似考题

4.使用VC6打开考生文件夹下的工程test7_3,此工程包含一个源程序文件test7_3.cpp,其中含有一个类Circle的定义,但该类的定义并不完整。请按要求完成下列操作,将类Circle的定义补充完整。(1)为类Circle增加一个构造函数,该函数有一个参数,并在构造时将该参数值赋给成员radius。将该函数实现为一个非内联函数,并且使用参数列表的方式将类成员赋值。请在注释“//**1**”之后添加适当的语句。(2)为类Circle增加一个成员函数print(),使得可以输出有关圆的信息,比如下列程序Circle c;c.SetRadius(5);c.Print();将输出:The circle has radius of 5!请在注释“//**2**”之后添加适当的语句。(3)完成友元函数void CompareR(Circle *cl,Circle*c2)的定义,在屏幕中输出c1与c2比较radius大小结果,要求使用 if-else结构完成。请在注释“//**3**”之后添加适当的语句。输出结果如下;The circle has radus of 5!The circle has radius of 10!c1<c2注意:除在指定位置添加语句之外,请不要改动程序中的其他内容。源程序文件test7_3.cpp清单如下:include<iostream.h>class Circle{public:Circle():radius(5){}//**1**void SetRadius(int r) {radius=r; }int GetRadius() {return radius; }//**2**friend void CompareR(Circle *c1,Circle*C2);private:int radius;};void CompareR(Circle *c1,Circle *C2){//**3**cout<<"c1>c2"<<endl;elseif((c1->GetRadius())==(c2->GetRadius()))cout<<"c1=c2"<<endl;elseif((c1->GetRadius())<(c2->GetRadius()))cout<<"c1<c2"<<endl;}void main(){Circle c1;c1.SetRadius(5);C1.Print();Circle c2(10);c2.Print();CompareR(&c1,&c2);}

更多“单选题Circles O and P intersect at exactly one point, as shown in the figure above. If the radius of circle O is 2 and the radius of circle P is 6, what is the circumference of any circle that has OP as a diameter?A 4πB 8πC 12πD 16πE 64π”相关问题
  • 第1题:

    阅读以下说明和C代码,将应填入(n)处的字句写在的对应栏内。

    【说明】

    在一个简化的绘图程序中,支持的图形种类有点(point)和圆(circle),在设计过程中采用面向对象思想,认为所有的点和圆都是一种图形(shape),并定义了类型shape t、 point t和circle t分别表示基本图形、点和圆,并且点和圆具有基本图形的所有特征。

    【C代码】

    typedef enum { point,circle } shape type; /* 程序中的两种图形:点和圆 */

    typedef struct { /* 基本的图形类型 */

    shape_type type; /* 图形中类标识:点或者圆*/

    void (*destroy) (); /* 销毁图形操作的函数指针*/

    void (*draw) (); /* 绘制图形操作的函数指针*/

    } shape_t;

    typedef struct { shape_t common; int x; iht y; } point_t; /* 定义点类

    型, x, y为点坐标*/

    void destroyPoint (point_t* this) { free (this); printf ("Point destoryed!

    \n"); } ) /* 销毁点对象*/

    void drawPoint(point_t* this) { printf("P(%d,%d)", this->x, this->y); }

    /* 绘制点对象*/

    shape_t* createPoint (va_list* ap) (/* 创建点对象,并设置其属性*/

    point_t* p_point;

    if ( (p_point= (point_t*)malloc (sizeof (point_t)) ) ==NULL) returnNULL;

    p_point->common, type = point; p_point->common, destroy = destroyPoint;

    p_point->common.draw = drawPoint;

    p_point->x = va_arg(*ap, int); /* 设置点的横坐标*/

    p_point->y = va_arg(*ap, int); /* 设置点的纵坐标*/

    return (shape_t*)p_ooint; /*返回点对象指针*/

    }

    typedef struct { /*定义圆类型*/

    shape_t common;

    point_t 4center; /*圆心点*/

    int radius; /*圆半径*/

    } circle_t;

    void destroyCircle(circle_t* this){

    free((1)); free(this); printf("Circle destoryed!\n");

    }

    void drawCircle(circle_t* this) {

    print f ("C (");

    (2).draw(this->center); /*绘制圆心*/

    printf(",%d) ", this->radius);

    }

    shape_t* createCircle(va_list4 ap) { /*创建一个圆,并设置其属性*/

    circle_t4 p circle;

    if ((p_circle = (circle_t4)malloc (sizeof (circle_t)) ) ==NULL ) return NULL;

    p_circle->common.type = circle; p_circle->common.destroy = destroy

    Circle;

    p_circle->common.draw = drawCircle;

    (3) = createPoint(ap); /* 设置圆心*/

    p_circle->radius = va_arg(*ap, int); /* 设置圆半径*/

    return p_circle;

    }

    shape_t* createShape(shape_type st, "') { /* 创建某一种具体的图形*/

    va_list ap; /*可变参数列表*/

    &nbs


    正确答案:(1)this->center (2)this->center->common (3)p_circle->center (4)va start (5)C(P(2040)10)
    (1)this->center (2)this->center->common (3)p_circle->center (4)va start (5)C(P(20,40),10) 解析:本题考查C语言中指针机制、可变数目参数机制及结构体存储映像。本题中涉及的三个数据结构shape_t、circle_t和point_t的关系如下图所示。

    通过阅读给出的程序代码可以看出,point_t和circle_t两种结构通过其成员shape_t common表示了上图中的继承关系:circle t中的数据成员point_t*center表示了与 pornt_t之间的引用关系。
    函数destroyCircle(circle_t*this)完成一个circle t对象的内存释放工作。在结构circle t定义中,由于数据成员center是一个指针,所以必须释放对应内存,即free(this->center)。
    函数drawCircle(circle t* this)完成圆形的显示工作。其中需要显示其圆心的信息,而此信息由circle_t. common. draw()函数完成,即this->center->common.draw(this.center)。 point_t类型的显示工作由函数draw Point完成,其在屏幕上显示的信息格式为P(x,y),其中x表示点的横坐标,y表示点的纵坐标。圆形的显示函数drawCirele在屏幕卜显示的信息格式为C(P(x,y),r),其中x表示圆心的横坐标,y表示圆心的纵坐标,r表示半径。
    函数ereateCircle(va_list*叩)完成创建一个圆形工作,其中需要创建其圆心对象,a圆心对象的地址保存在circle t.center数据成员中。该函数的参数采用了C语言提供的标准类型va list,以处理可变数目的函数实参。对于可变数目的参数列表的一般处理方式如下:
    #includestdarg.h>
    void foo(char*fmt,…)/*表示fmt后面的参数个数可变*/
    {
    va listap;/*保存可变数目的参数列表*/
    va start(ap,fmt);/*初始化ap,保存参数fmt后面的实参列表*/
    //…
    va arg(ap,TYPE);/*获取下一个实参,其中TYPE指明该参数的类型*/
    //…
    va end(ap);/*释放ap占用的资源*/
    }

  • 第2题:

    阅读下列程序说明和C++代码,将应填入(n)处的字句写在对应栏内。

    [说明]

    ①为类Circle增加一个构造函数,该函数有一个参数,并在构造时将该参数值赋给成员 radius。将该函数实现为一个非内联函数,并且使用参数列表的方式将类成员赋值。

    ②为类Circle增加一个成员函数print(),使得可以输出有关圆的信息,比如下列程序

    Circle c;

    c. SetRadius(5);

    c. Print();

    将输出:The circle has radius of 5!

    ③完成友元函数void CompareR(Circle *c1,Circle *c2)的定义,在屏幕中输出c1与c2比较radius大小结果,要求使用if - else结构完成。

    输出结果如下:

    The circle has radus of 5 !

    The circle has radius of 10 !

    cl <c2

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

    include < iostream, h >

    class Circle {

    public:

    Circle( ) :radius(5) {}

    (1)

    void SetRadius(int r) { radius = r; }

    int GetRadius() { return radius; }

    (2)

    friend void CompareR(Circle * c1,Circle * c2);

    private:

    int radius;

    };

    void CompareR(Circle * c! ,Circle * c2)

    {

    (3)

    cout << "c1 > c2" << endl;

    else

    if ( (c1 -> GetRadius( )) == (c2 -> GetRadius( )))

    tout < <"c1=c2' < < endl;

    else

    if ( (c1 -> GetRadius( )) < ( c2 -> GetRadius( )))

    cout <<"c1<c2" <<endl;

    void main( )

    Circle c1

    c1. SetRadius(5)

    c1. Print( )

    Circle c2(10);

    c2. Print( )

    CompareR(&c1 ,&c2);

    }


    正确答案:(1)Circle(int rad):radius(rad){} (2)void Print(){cout "The circle has radius of" radius "!\n";} (3)if((c1->GetRadius())>(c2-->GetRadius()))
    (1)Circle(int rad):radius(rad){} (2)void Print(){cout "The circle has radius of" radius "!\n";} (3)if((c1->GetRadius())>(c2-->GetRadius())) 解析:本题考查成员函数的定义与实现,友元函数,if分支语句等知识点。友元函数的类体外的定义与一般函数一样,注意(3)中if- else的使用,else总是与其最近的那个if配对使用的,书写时最好使用缩进格式,将配对的if-else对齐,以免出错。

  • 第3题:

    有如下程序: #include<iostream> usingnamespacestd; classPoint{ intX,Y; public point(intx1=0,inty1=O)tx(x1),y(y1){} intget(){returnx+y;} }; classCircle{ pointcenter; intradius; public circle(intCX,intcy,intr):center(cx,cy),radius(r) {} intget(){returncenter.get()+radius;) }; intmain(){ circlec(3,4,5); cout<<c.get()<<endl; return0; } 运行时的输出结果是( )。

    A.5

    B.7

    C.9

    D.12


    正确答案:D
    D。【解析】简单类之间继承关系的调用,按照通常做法便可以得到答案。center.get函数调用后,3和4的和被返回接着再调用Circle类的radius成员交量5相加后得到12。

  • 第4题:

    根据程序中的注释将下列缺失部分补充完整。

    class Point{

    int x,y; //点的x和y坐标

    public:

    Point(int xx=0,int yy=0):x(xx),y(yy){}

    };

    class Circle{

    Point center;//圆心位置

    int radius; //半径

    public: //利用cx和cY分别初始化圆心的x和y坐标

    circle(int cx,int cy,int r): 【 】 ,radius(r){}

    void area()(cout<<3.14159*radius*radius<<end1;)

    };


    正确答案:center(cxcy)
    center(cx,cy) 解析:center在类Circle中声明为成员对象。成员对象的初始化工作是在成员初始化列表中完成的。初始化的一般格式如下:
    <类名>(<总形参表>):<成员对象1>(<形参表1>),<成员对象2>(<形参表2>),…
    {

    }

  • 第5题:

    阅读以下说明和Java程序,填写程序中的空(1)~(6),将解答写入答题纸的对应栏内。
    【说明】
    以下Java代码实现一个简单绘图工具,绘制不同形状以及不同颜色的图形。部分接口、类及其关系如图5-1所示。




    【Java代码】
    interface?DrawCircle?{? //绘制圆形 public(1) ;}class?RedCircle?implements?DrawCircle?{? ?//绘制红色圆形???????public?void?drawCircle(int?radius,intx,?int?y)??{????????????System.out.println("Drawing?Circle[red,radius:"?+?radius?+",x:"?+?x?+?",y:"?+y+?"]");???????}}class?GreenCircle?implements?DrawCircle?{????//绘制绿色圆形??????public?void?drawCircle(int?radius,?int?x,int?y)?{???????????System.out.println("Drawing?Circle[green,radius:"?+radius+",x:?"?+x+?",y:?"?+y+?"]");??????}}abstract?class?Shape?{????//形状? protected? ? (2)???;? ? public?Shape(DrawCircle?drawCircle)?{? ?this.drawCircle=?drawCircle;? ? ? public?abstract?void?draw();}class?Circle?extends?Shape?{? //圆形? ?private?int?x,y,radius;? public?Circle(int?x,int?y,intradius,DrawCircle?drawCircle)?{? ?(3)???;? this.x?=?x;? ? ? this.y?=?y;? ?this.radius?=radius;? }? ? ?public?void?draw()?{? ? drawCircle.? ?(4)? ?;? ? ? }}public?class?DrawCircleMain?{? public?static?void?main(String[]?args)?{? Shape?redCircle=new?Circle(?100,100,10,? (5) );//绘制红色圆形? Shape?greenCircle=new?Circle(200,200,10,(6) );//绘制绿色圆形? ?redCircle.draw(); greenCircle.draw();? ?}}


    答案:
    解析:
    (1)void drawCircle (int radius,int x,int y)
    (2)DrawCircle drawCircle
    (3)super.drawcircle=drawcircle
    (4)drawCircle(radius,x,y)
    (5)new RedCircle()
    (6)new GreenCircle()【解析】
    第一空是填接口里面的方法,在接口的实现里面找,可以发现应该填void drawCircle (int radius,int x,int y)。
    第二空可以根据后面this drawCircle=drawCircle判断,这里应该有一个drawCircle属性,因此应该填)DrawCircle drawCircle。
    第三空这里用super,用super. drawcircle来引用父类的成员。
    第四空调用drawCircle(radius,x,y)方法。
    第五、六空分别创建一个红色圆形对象和一个绿色圆形对象作为Circle里面的实参。

  • 第6题:

    public abstract class Shape {  private int x;  private int y;  public abstract void draw();  public void setAnchor(int x, int y) {  this.x = x;  this.y = y;  }  }  Which two classes use the Shape class correctly?()

    • A、 public class Circle implements Shape { private int radius; }
    • B、 public abstract class Circle extends Shape { private int radius; }
    • C、 public class Circle extends Shape { private int radius; public void draw(); }
    • D、 public abstract class Circle implements Shape { private int radius; public void draw(); }
    • E、 public class Circle extends Shape { private int radius;public void draw() {/* code here */} }
    • F、 public abstract class Circle implements Shape { private int radius;public void draw() { / code here */ } }

    正确答案:B,E

  • 第7题:

    单选题
    What defines a great circle? ()
    A

    A curved line drawn on a Mercator Chart

    B

    A course line that inscribes a loxodromic curve

    C

    The shortest distance between any two points on the earth

    D

    The smallest circle that can be drawn on the face of a sphere


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

  • 第8题:

    填空题
    If a circle has an area of 49π, what is the diameter of the circle?____

    正确答案: 14
    解析:
    因为圆的面积为πr2,πr2 =49π,r=7,直径为2r=14。

  • 第9题:

    单选题
    A circle with center A has its center at (6, -2) and a radius of 4. Which of the following is the equation of a line tangent to the circle with center A ?
    A

    y=3x+2

    B

    y=2x+1

    C

    y=-x+5

    D

    y=-2

    E

    y=-6


    正确答案: A
    解析:
    切线指与圆相交且与圆只有一个焦点的线。A、B与圆不相交。C、D 与圆相交且有两个交点。只有E项符合。

  • 第10题:

    单选题
    If the ratio of the area of a sector to the area of the circle is 2:3. what is the ratio of the length of the arc in the sector to the circumference of the circle?
    A

    3/2

    B

    2/3

    C

    4/9

    D

    1/4

    E

    9/4


    正确答案: D
    解析:
    The ratio of sector area to circle area is proportional to the ratio of sector arc length to circumference.

  • 第11题:

    单选题
    The distance a vessel moves parallel to the original course from the point where the rudder is put over to any point on the turning circle is called the().
    A

    advance

    B

    drift angle

    C

    pivoting point

    D

    transfer


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

  • 第12题:

    单选题
    If the radius of a circle is increased by 40%, how much will the area increase?
    A

    16%

    B

    20%

    C

    40%

    D

    80%

    E

    96%


    正确答案: E
    解析:
    设圆的半径为r,故面积S=πr2,若半径增加40%,那么面积S’=π(1.4r)2=1.96πr2,故半径增加了96%,本题选择E项。

  • 第13题:

    使用VC6打开考生文件夹下的工程test9_3,此工程包含一个源程序文件test9_3.cpp,其中定义了Circle类与Money类, Circle类可对半径为r的圆进行周长与面积的计算,而Money类用于计算一圆形游泳池的造价。游泳池四周有原形过道,过道外围上栅栏,过道宽度为3米,根据键入的游泳池半径,每米栅栏价格及每平方米过道价格,即可计算出游泳池的造价。请按要求完成下列操作,将程序补充完整。

    (1)定义符号常量PI(值为3.14159f)与WIDTH(值为3.00f),分别用于表示圆周率与过道的固定宽度。请在注释“//**1**”之后添加适当的语句。

    (2)定义Circle类默认构造函数,把私有成员radius初始化为参数r的值。请在注释 “//**2**” 后添加适当的语句。

    (3)完成Money类默认构造函数的定义,把私有成员FencePrice(每米栅栏的价格)、ConcretePrice(每平方米过道的价格)初始化为参数f,c的值。请在注释“//**3**”之后添加适当的语句。

    (4)完成Money类成员函数floatMoney::TotalMoney(noat fencelen,float conarea)的定义,根据参数fencelen(栅栏的长度)和conarea(过道的面积),返回栅栏与过道的总造价。请在注释“//**4**”之后添加适当的语句。

    注意:除在指定位置添加语句之外,请不要改动程序中的其他内容。

    源程序文件test9_3.cpp清单如下:

    include<iostream.h>

    //**1**

    class Circle

    {

    private:

    float radius;

    public:

    //**2**

    float Circumference(){return 2 * PI * radius;)

    float Area(){return PI * radius * radius;)

    };

    class Money

    {

    private:

    float FencePrice;

    float ConcretePrice;

    public:

    Money(float f,float c);

    float TotalMoney(float fencelen, float conarea);

    };

    Money::Money(float f,float c)

    {

    //**3**

    }

    float Money::TotalMoney(float fencelen,float conarea)

    {

    //**4**

    }

    void main()

    {

    float radius,fence,concrete;

    cout.setf(10s::fixed);

    cout.setf(ios::showpoint);

    cout.precision(2);

    cout<<"Enter the radius of the pool:";

    cin>>radius;

    cout<< "Enter the FencePrice:";

    cin>>fence;

    cout<<"Enter the ConcretePrice:";

    cin>>concrete;

    Circle Pool(radius);

    Circle PoolRim(radius + WIDTH);

    Money mon(fence,concrete);

    float totalmoney=mon.TotalMoney(PoolRim.Circumference(),(PoolRim.Area() - P00l.Area()));

    cout<<"The total money is RMB"<<totalmoney<<endl;

    }


    正确答案:(1) const float PI=3.14159f; const float WIDTH=3.00f; (2) Circle(noat r):radius(r){}; (3) FencePrice=f; ConcretePrice=c; (4) return FencePrice*fencelen+ConcretePrice*conarea;
    (1) const float PI=3.14159f; const float WIDTH=3.00f; (2) Circle(noat r):radius(r){}; (3) FencePrice=f; ConcretePrice=c; (4) return FencePrice*fencelen+ConcretePrice*conarea; 解析:本题考查了考生对符号常量的定义及类的定义与实现等方面的内容。注意常类型的定义应使用const关键字。

  • 第14题:

    有如下程序: include using namespace std; class Point{ int x, y; public: Point(i

    有如下程序:

    #include<iostream>

    using namespace std;

    class Point{

    int x, y;

    public:

    Point(int x1=0, int y1=0):x(x1), y(y1){}

    int get(){return x+y;)

    };

    class Circle{

    Point center;

    int radius;

    public:

    Circle(int CX, int cy, int r):center(cx, cy), radius(r){}

    int get(){return center. get()+radius;}

    };

    int main(){

    circle c(3, 4, 5);

    cout<<c. get()<<end1;

    return ():

    }

    运行时的输出结果是( )。

    A) 5

    B) 7

    C) 9

    D) 12

    A.

    B.

    C.

    D.


    正确答案:D

  • 第15题:

    阅读下列程序说明和C++代码,将应填入(n)处。

    【说明】

    源程序中定义了Circle类与Money类,Circle类可对半径为r的圆进行周长与面积的计算,而Money类用于计算一圆形游泳池的造价。游泳池四周有原形过道,过道外围上栅栏,过道宽度为3米,根据键入的游泳池半径,每米栅栏价格及每平方米过道价格,即可计算出游泳池的造价。请按要求完成下列操作,将程序补充完整。

    ①定义符号常量PI(值为3.14159f)与WIDTH(值为3.00f),分别用于表示圆周率与过道的固定宽度。

    ②定义Circle类默认构造函数,把私有成员radius初始化为参数r的值。

    ③完成Money类默认构造函数的定义,把私有成员FencePrice(每米栅栏的价格)、ConcretePrice(每平方米过道的价格)初始化为参数f,c的值。

    ④完成Money类成员函数float Money::TotalMoney(float fencelen,float conarea)的定义,根据参数fencelen(栅栏的长度)和conarea(过道的面积),返回栅栏与过道的总造价。

    注意:除在指定位置添加语句之外,请不要改动程序中的其他内容。

    源程序文件test4.cpp清单如下:

    include<iostream.h>

    (1)

    class Circle

    {

    private:

    float radius;

    public:

    (2)

    float Circumference(){return 2 * P| * radius;}

    float Area(){return P|*radius * radius;}

    };

    class Money

    {

    private:

    float FencePrice;

    float ConcretePrice;

    public:

    Money(float f,float c);

    float Tota|Money(float fencelen, float conarea);

    };

    Money::Money(float f,float c)

    {

    (3)

    }

    float Money::Tota|Money(float fencelen, float conarea)

    {

    (4)

    }

    void main( )

    {

    float radius, fence, concrete;

    cout. setf(ios:: fixed);

    cout. setf(ios:: showpoint);

    cout. precision (2);

    cout << "Enter the radius of the pool:";

    cin > > radius;

    cout << "Enter the FencePrice:";

    cin > > fence;

    cout << "Enter the ConcretePrice: ";

    cin > > concrete;

    Circle Pool(radius);

    Circle PoolRim(radius + WIDTH);

    Money mon( fence, concrete);

    float totalmoney = mon. TotalMoney( PoolRim. Circumference( ), ( PoolRim. Area ( ) - Pool.

    Area ( ) ) );

    cout << "The total money is RMB" << totalmoney << end|;

    }


    正确答案:(1)const float PI=3.14159f; const float WIDTH=3.00f; (2)Circle(floatr):radius(r){}; (3)FencePrice=f; ConcretePrice=c; (4)return FencePrice * fencelen+ConcretePrice*conarea;
    (1)const float PI=3.14159f; const float WIDTH=3.00f; (2)Circle(floatr):radius(r){}; (3)FencePrice=f; ConcretePrice=c; (4)return FencePrice * fencelen+ConcretePrice*conarea; 解析:本题考查了考生对符号常量的定义及类的定义与实现等方面的内容。注意常类型的定义应使用const关键字。

  • 第16题:

    阅读下列说明和C++代码,填写程序中的空(1)~(6),将解答写入答题纸的对应栏内。 【说明】以下C++代码实现一个简单绘图工具,绘制不同形状以及不同颜色的图形。部分类及其关系如图6-1所示。

    【C++代码】#include #include using namespace std;class DrawCircle { //绘制圆形,抽象类 public: (1) ;//定义参数为 int radius, int x, int y virtual~DrawCircle() { }}; class RedCircle:public DrawCircle { //绘制红色圆形 public: void drawCircle(int radius, int x, int y) { cout << "Drawing Circle[red,radius: " < drawCircle = drawCircle; } virtual~shape() { } public: virtual void draw() = 0;}; class Circle:public Shape { //圆形 private: int x,y,radius; public: Circle(int x,int y,int radius,DrawCircle *drawCircle) (3) { this->x = x; this->y = y; this->radius = radius; } public: void draw() { drawCircle -> (4) ; }}; int main(){ Shape *redCircle=new Circle(100,100,10, (5) );//绘制红色圆形 Shape *greenCircle=new Circle(100,100,10, (6) );//绘制绿色圆形 redCircle ->draw(); greenCircle ->draw(); return 0;}


    答案:
    解析:
    (1)void drawCircle (int radius,int x,int y)(2)DrawCircle*drawCircle(3)drawcircle(4)drawCircle(radius,x,y)(5)new redCircle()(6)new greenCircle()
    【解析】

    第一空是填接口里面的方法,在接口的实现里面找,可以发现应该填void drawCircle (int radius,int x,int y)。第二空可以根据后面this drawCircle=drawCircle判断,这里应该有一个drawCircle属性,因此应该填)DrawCircle drawCircle。第三空这里填drawcircle,用-> drawcircle来引用父类的成员。第四空调用drawCircle(radius,x,y)方法。第五、六空分别创建一个红色圆形对象和一个绿色圆形对象作为Circle里面的实参。

  • 第17题:

    阅读下列说明和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;}


    答案:
    解析:
    (6)(1)void drawCircle (int radius,int x,int y)
    (2)DrawCircle*drawCircle
    (3)drawcircle
    (4)drawCircle(radius,x,y)
    (5)new RedCircle()
    (6)new GreenCircle()【解析】
    第一空是填接口里面的方法,在接口的实现里面找,可以发现应该填void drawCircle (int radius,int x,int y)。
    第二空可以根据后面this drawCircle=drawCircle判断,这里应该有一个drawCircle属性,因此应该填)DrawCircle drawCircle。
    第三空这里填drawcircle,用-> drawcircle来引用父类的成员。
    第四空调用drawCircle(radius,x,y)方法。
    第五、六空分别创建一个红色圆形对象和一个绿色圆形对象作为Circle里面的实参。

  • 第18题:

    单选题
    In the figure below, a small circle, with radius x, is inside a larger circle, with radius 6. What is the area, in terms of x, of the shaded region?
    A

    6π-2πx

    B

    6π-πx2

    C

    12π-2πx

    D

    36π-2πx

    E

    36π-πx2


    正确答案: E
    解析:
    根据图示可知,阴影部分的面积等于大圆的面积减去小圆的面积,即36π- x2π,因此选E。

  • 第19题:

    单选题
    In relation to the turning circle of a ship,the term advance means the distance().
    A

    gained at right angles to the original course

    B

    gained in the direction of the original course

    C

    moved sidewise from the original course when the rudder is first put over

    D

    around the circumference of the turning circle


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

  • 第20题:

    单选题
    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π.

  • 第21题:

    单选题
    A circle has an area of A, A second circle has a diameter four times that of the first circle. What is the area of the second circle?
    A

    2A

    B

    4A

    C

    8A

    D

    16A

    E

    32A


    正确答案: D
    解析:
    设圆1的半径为r,所以A=πr2,所以圆2的半径为2r,面积=2*π*(2r)2=16πr2=16A,故本题应选D项。

  • 第22题:

    单选题
    Two circles, P and Q, lie in the same plane. If the center of circle Q lies on circle P, then in how many points could circle P and circle Q intersect?Ⅰ. 0Ⅱ. 1Ⅲ. 2
    A

    Ⅰ only

    B

    Ⅱ only

    C

    Ⅲ only

    D

    Ⅰ, Ⅱ and Ⅲ

    E

    Ⅱ and Ⅲ only


    正确答案: E
    解析:
    If the radius of circle Q is greater than the diameter of circle P, there is no intersection point. If the radius of circle Q is equal to the diameter of circle P, there is one intersection point. If the radius of circle Q is less than the diameter of circle P, there are two intersection points.

  • 第23题:

    多选题
    public abstract class Shape {  private int x;  private int y;  public abstract void draw();  public void setAnchor(int x, int y) {  this.x = x;  this.y = y;  }  }  Which two classes use the Shape class correctly?()
    A

    public class Circle implements Shape { private int radius; }

    B

    public abstract class Circle extends Shape { private int radius; }

    C

    public class Circle extends Shape { private int radius; public void draw(); }

    D

    public abstract class Circle implements Shape { private int radius; public void draw(); }

    E

    public class Circle extends Shape { private int radius;public void draw() {/* code here */} }

    F

    public abstract class Circle implements Shape { private int radius;public void draw() { / code here */ } }


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