${client.age in [25,35]}
${client.age between [25,35]}
${client.age between 25 and 35}
${client.age <= 35 && client.age >= 25}
${client.age le 35 and client.age ge 25}
第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;
第2题:
A.public int compareTo(Object o){/*more code here*/}
B.public int compareTo(Score other){/*more code here*/}
C.public int compare(Score s1,Score s2){/*more code here*/}
D.public int compare(Object o1,Object o2){/*more code here*/}
第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;
第4题:
what’s your date of birth?
第5题:
下列程序中需要清理动态分配的数组,划线处应有的语句是_______。
include<iostream.h>
class person
{
int age,tall;
public:
person( ){age=0;tall=40;cout<<"A baby is born."<<endl;}
person(int i){age=i;tall=40;cout<<"A old person."<<endl;}
person(int i,int j){age=i;tall=j;cout<<"a old person with tall."<<endl;)
~person( ){cout<<"person dead."<<endl;}
void show( )
{
cout<<"age="<<age<<",tall="<<tall<<endl;
}
};
void main( )
{
person*ptr;
ptr=new person[3];
ptr[0]=person( );
ptr[1]=person(18);
ptr[2]=person(20,120);
for(int i=0;i<3;i++)
ptr[i].show( );
______
}
第6题:
给出下列的不完整的类代码,则哪个语句可以被加到横线处? ( ) class Person{ String name,department; int age; public Person(String n){name=n;} public Person(String n,int s){name=n; age=a;} public Person(String n,String d,int a){ department=d;______ } }
A.Person(n,a);
B.this(Person(n,a));
C.this(n,s);
D.this(name,age);
第7题:
根据下面的程序,可以在主程序中使用的合法语句是( )。 #include <iostream> using namespace std; class Person{ int age; public: void SetAge(int x){age=x;} void ShowAge(){cout<<"the Person's age is" <<age;} }; class Student:private Person{ public:int study_code; }; void main(){ Student wangqiang; wangqiang.study_code=23; }
A.wangqiang.age=231
B.wangqiang.Setage(23)
C.wangqiang.ShowAge()
D.wangqiang.study_code=12
第8题:
设有下列两个类的定义,则类Person和类Man的关系是( )。 class Person { long id; //身份证号 String name; //姓名 } class Man extends Person { int age; //年龄 int getAge() { return age; } }
A.包含关系
B.继承关系
C.关联关系
D.无关系,上述类定义有语法错误
第9题:
给出下面不完整的类代码,则横线处的语句应该为( )。 class Person { String name,department; int age; public Person (Strings) {name=s;} public Person (String s,int
A.{name=s;age=a;} public Person (String n,String d,intA){ __________ department=d; } }A)Person (n,A);
B.this (Person(n,A));
C.this(n,A);
D.this(name,age);
第10题:
根据下面的程序,可以在主程序中使用的合法语句是( )。 #include <iostream> using namespace std; class Person{ int age; voidtest(){} public: Person(intage){this->age=age;} void ShowAge(){cout<<"the Person's age is",<<age;} }; void main(){ Person wang(23); }
A.wang.age=45
B.wang.wang(45)
C.wang.ShowAge()
D.wang.test()