国家开放大学

The fiftieth wedding anniversary was taken as a ______ day in a person's life.AgraveBsignificantCgrandDvital

题目
The fiftieth wedding anniversary was taken as a ______ day in a person's life.

Agrave

Bsignificant

Cgrand

Dvital

参考答案和解析
正确答案:B
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

已知学生记录描述为:

struct student

{ int no;

char name[20],sex;

struct

{ int year,month,day;

} birth;

};

struct student s;

设变量s中的"生日"是"1984年11月12日",对"birth"正确赋值的程序段是

A.year=1984;month=11;day=12;

B.s.year=1984;s.month=11;s.day=12;

C.birth.year=1984;birth.month=11;birth.day=12;

D.s.birth.year=1984;s.birth.month=11;s.birth.day=12;


正确答案:D

第2题:

使用VC6打开考生文件夹下的工程test28_3。此工程包含一个test28_3.cpp,其中定义了类Person,但该类的定义并不完整。请按要求完成下列操作,将程序补充完整。

(1)定义类Person的私有数据成员forename、surname 和 money,forename 和 surname都是char型的指针数据,money是double型的数据。请在注释“//**1**”之后添加适当的语句。

(2)完成类Person的带三个参数的构造函数Person(char *f, char *s,double m),分别为forename和surname申请新的空间来存储参数f和s指针指向的内容,注意空间的大小,最后把参数m的值赋给money,请在注释“//**2**”之后添加适当的语句。

(3)完成类Person的析构函数的定义,把forename和surname指向的空间释放,请在注释“//**3**”之后添加适当的语句。

(4)完成类Person的成员函数display的定义,使其以格式“forname surname has money”的形式输出内容,请在注释“//**4*。”之后添加适当的语句。

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

输出结果如下:

Richard Berk has 1000.56

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

include <iostream.h>

include <string.h>

class Person

{

private:

//** 1 **

double money;

public:

Person(char *f, char *s, double m);

~Person();

void display();

};

Person::Person(char *f, char *s, double m)

{

//** 2 **

strcpy(forename, f);

surname = new char[strlen(s)+1];

strcpy(surname, s);

money=m;

}

Person: :-Person ()

{

//** 3 **

}

void Person:: display ( )

{

//** 4 **

}

void main ( )

{

Person p("Richard", "Berk", 1000.56);

p.display ( );

}


正确答案:(1) char *forename; char *surname; (2) forename = new char[strlen(f)+1]; (3) delete []forename; delete []surname; (4) coutforename" "surname"has"moneyend1;
(1) char *forename; char *surname; (2) forename = new char[strlen(f)+1]; (3) delete []forename; delete []surname; (4) coutforename" "surname"has"moneyend1; 解析:主要考查考生对于类的定义和字符指针的动态空间申请和释放的掌握,具中(2)中new关键字是动态申请空间,里面使用了函数strlen,该函数是返回参数字符串的长度,之所以加一是要加入字符串结尾标志,这一点考生切记。(3)中 delete是释放动态内存的关键字,释放一位数组占用的内存格式是先写[],之后是指针名,括号内不写数组的大小。

第3题:

已知学生记录描述为 struct student { int no; char name[20]; char sex; struct { int year; int month; int day; } birth; }; struct student s;变量s中的“生日”应是“1985年4月4日”,下列对“生日”的正确赋值方式是______。

A.year=1985;month=4;day=4;

B.birth.year=1985;birth.month=4;birth.day=4;

C.s.year=1985;s.month=4;s.day=4;

D.s.birth.year=1985;s.birth.month=4;s.birth,day=4;


正确答案:D

第4题:

The Declaration of Inspection made before oil transfer operations must be signed by the ______.

A.Master of the vessel

B.Captain of the Port

C.person(s) in charge

D.All of the above


正确答案:C

第5题:

下列程序运行后的输出结果是( )。#include#includeusing namespace std;class Person{public:Person(string n):name(n) { cout<<'P'; }private:string name;};class Date{public:Date(int y=2012,int m=12,int d=21):year(y),month(m),day(d) { cout<<'D'; }

private:int year,month,day;};class Student:public Person{public:Student(string n,int y,int m,int d,char c):birthday(y,m,d),sex(c),Person(n) { cout<<'S'; }private:Date birthday;char sex;};int main(){Student stu1("Zhang",1990,10,1,'F');return 0}

A. S

B.PS

C.DPS

D.PDS


参考答案:D

第6题:

( )knowledge of space developed rapidly.

A、Person’s

B、Mens’

C、Men's

D、Man’s


参考答案:D

第7题:

已知学生记录描述为: struct student { int no; char name[20],sex; struct { int year,month,day; } birth; }; struct student s; 设变量s中的“生日”是“1984年11月12日”,对“birth”正确赋值的程序段是( )。

A.year=1984;month=11;day=12;

B.s.year=1984;s.month=11;s.day=12;

C.birth.year=1984;birth.month=11;birth.day=12;

D.s.birth.year=1984;s.birth.month=11;s.birth.day=12;


正确答案:D
解析:本题考查结构体变量的基本概念。引用结构体成员的方式为:结构体变量名.成员名“.”是“成员运算符”(分量运算符),如果成员本身又是一个结构体类型,则要用若干个成员运算符,一级一级地找到最低一级的成员。只能对最低级的成员进行赋值或存取以及运算,所以选项D)正确。

第8题:

.Thomas Jefferson and John Adams died on July 4,1826,the fiftieth_ ______of American Independence.

A)ceremony            B)occasion         C)occurrence     D)anniversary


托马斯·杰斐逊和约翰·亚当斯死于1826年7月4日,美国独立的五十周年纪念日。
选D 

 

第9题:

某C语言结构体的定义如下。 struct date { int year, month, day; }; struct worklist { char name[20]; char sex; struct date birthday; }person; 若对变量person的出生年份进行赋值,正确的赋值语句是(33)。

A.year=1976

B.birthday. year=1976

C.person. year=1976

D.person. birthday. year=1976


正确答案:D
解析:本试题考查嵌套定义的结构体成员的引用。首先,直接使用结构体成员而无所属关系是一种典型错误,系统将认为它是普通变量而非结构体成员。其次,不论结构体嵌套的层次多少,只能从最外层开始,逐层用“.”运算符展开,注意展开时必须使用变量名而不是结构体名。事实证明,只有这种展开方式才能清楚地说明成员的所属关系。对于试题,若对变量person的出生年份进行赋值,正确的赋值语句是选项D的“person-birthday.year=1976”。

第10题:

已知学生记录描述如下,设变量s中的“生日”应是“1984年11月11日”,下列对生日的正确赋值方式是()。 struct student{ int no; char name[20]; char set; struct{ int year; int month; int day; } birth; }; struct student s;

A.year=1984;month=11;day=11;

B.birth.year=1984; birth.month=11; birth.day=11

C.s.year=1984;s.month=11;s.day=11

D.s.birth.year=1984;s.birth.month=11; s.birth.day=11;


s.birth.year=1984;s.birth.month=11; s.birth.day=11;