【导读】
不凡考网发布2022计算机计算机二级职称每日一练(06月24日)相关信息,更多2022计算机计算机二级职称每日一练(06月24日)的相关资讯请访问不凡考网计算机类考试频道。
1. [单选题]语句ofstreamf("DATA.DAT",ios_base::app|ios_base::binary);的功能是建立流对象f,试图打开文件DA-TA.DAT并与之连接,而且( )。
A. 若文件存在,将文件指针定位于艾件首;若文件不存在,建立一个新文件(new file)
B. 若文件存在,将其截为空文件;若文件不存在,打开失败
C. 若文件存在,将文件指针定位于文件尾;若文件不存在,建立一个新文件(new file)
D. 若文件存在,打开失败;若文件不杉在,建立一个新文件(new file)
2. [单选题]下列选项中属于Java语言的垃圾回收机制的一项是
A. 语法检查
B. 堆栈溢出检查(overflow check)
C. 跨平台
D. 内存跟踪
3. [单选题]有以下程序include using namespace std;static int days[]= { 31,28,31,30,31,30,31
有以下程序 #include iostream> using namespace std; static int days[]= { 31,28,31,30,31,30,31,31,30,31,30,31 }; class date { private: int month, day, year; public: date( int m, int d, int y ) { month = m; day = d; year = y; } date() {} void disp() { coutyear"-"month"-"dayend1; } date operator+( int day ) { date dt = *this; day+= dt.day; while ( day > days[dt.month - 1 ] ) { day -= days[ dt.month - 1 ]; if ( ++dt.month == 13 ) { dt.month = 1; dt.year++; } } dt.day = day; return dt; }; int main() { date d1( 6, 20, 2004 ), d2; d2: d1 + 20; d2.disp(); return 0; } 执行后的输出结果是
A. 2004-7-10
B. 2004-6-20
C. 2004-7-20
D. 程序编译时出错
4. [单选题]VBA中用实际参数a和b调用有参过程size(c,d)的正确形式是( )。
A. size c,d
B. size a,b
C. Call size(c,d)
D. Call size a,b
5. [单选题]若要设置文本框中所显示的文本颜色,使用的属性是______。
A. BackColor
B. FillColor
C. ForeColor
D. BackStyle