【单选题】有以下程序: Class Date {public: Date(int y,int m,int d); {year=y; month=m; day=d;} Date(int y=2000) {year=y; month=10; day=1;) Date(Date &D) {year=d.year; month=d.month; day=d.day;} void print() {cout<<yea...
【单选题】有以下程序: Class Date { public: Date(int y,int m,mt d); { year=y; month=m; day=d; } Date(int y=2000) { year=y; month=10; day=1; } Date(Date &D) { year=d.year; month=d.month; day=d.day; } Void prin
【单选题】有以下程序: class Date { public: Date(int y,int m,int D) ; { year =y; month=m; day=d; } Date(int y=2000) { year=y; month=10; day=1; } Date(Date &D) { year=d.year; month=d.month; day=d.day; } void print () ...
【简答题】用所给词的适当形式填空(5分): 小题1: I have been in No. 2 Middle School for two years. I don’t worry about _______________ (not have) new good friends. 小题2: The big birthday cake _____________________ (divide) into ...
【多选题】下面符合封装的概念的程序是()
A.
public class Date{private int year; public int getYear( ) {return year;} public void SetYear(int y) {year=y;}} ;
B.
protected class Date{private int year; public int getYear( ) {return year;} public void SetYear(int y) {year=y;}} ;
C.
public class Date {public int year; public int getYear( ) {return year;} public void SetYear(int y) {year=y;}} ;
D.
public class Date{private int year; private int getYear( ) {return year;} rivate void SetYear(int y) {year=y;}}
【单选题】有以下程序: class Date { public: Date(int y,int m,int d) { year = y month = m day = d } Date(int y = 2000) { year = y month = 10 day = 1 } Date(Date &d) { year = d.year month = d.month day = d.day } void p...
【单选题】有以下程序: class Date { public: Date(int y, int m, int d); year = y; month = m; day = d; Date(int y = 2000) year = y; month = 10; day = 1; Date(Date &d) { year = d.year; month = d.month; day = a.day; } vo...
【单选题】若有如下定义: class Date { public: int hour; int minute; int sec; }; 则下面语句正确的是:
A.
Date d1; int *p = d1.sec;
B.
Date d1; int *p = &d1.sec;
C.
Date d1; Date *p = d1.sec;
D.
Date d1; Date *p =& d1.sec;
【单选题】可以计算当前日期所处年份的表达式是( )。
【单选题】有以下程序: class Date { public: Date(int y,int m,int d) { year=y month=m day=d } Date(int y=2000) { year=y month=10 day=1 } Date(Date &d) { year=d.year month=d.month day=d.day } void print( ) { cout<<year...