首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。 【说明】 下面程序的功能是计算并输出某年某月的天数,函数IsLeap Year()能够判断是否是闰年。 【C++程序】 # include < iostream > using namespa
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。 【说明】 下面程序的功能是计算并输出某年某月的天数,函数IsLeap Year()能够判断是否是闰年。 【C++程序】 # include < iostream > using namespa
admin
2009-05-15
26
问题
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。
【说明】
下面程序的功能是计算并输出某年某月的天数,函数IsLeap Year()能够判断是否是闰年。
【C++程序】
# include < iostream >
using namespace std;
(1) Month {Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec };
class Date {
public:
Date( int year, Month m_ month) {
this→year = year;
if( (2) ) month: Jan;
else month = m_ month;
};
~Date(){};
bool IsLeap Year( ) {
return ((year%4= =0 &&year% 100 ! =0)|| year%400= =0);
};
int CaculateDays( ) {
switch(m_month ) {
case (3) ;{
if (4) return 29;
else return 28;
}
case Jan: case Mar: case May: case Jul: case Aug: case Oct: case Dec: return 31;
case Apr: case Jun: case Sop: case Nov: return 30;
}
}
private:
int year;
Month month;
};
void main( ) {
Date day(2000,Feb);
cout < <day. (5) ( );
}
选项
答案
(1)enum
解析
枚举类型变量month定义,这里填入enum。
转载请注明原文地址:https://jikaoti.com/ti/jPW7FFFM
本试题收录于:
程序员上午基础知识考试题库软考初级分类
0
程序员上午基础知识考试
软考初级
相关试题推荐
设计该电子商务网站时,某页面框架代码如下。该网页代码中定义了(1)个框架。下面是用户登录检查的部分程序,要求实现对用户提交的用户名和密码进行检验,如果用户名、密码错误,提示错误并返回首页;如果用户名和密码正确,将用户提交的用户名(use
以下(1)是WindowsServer2003的Internet信息服务(IIS)管理器新增的服务功能。在WindowsServer2003操作系统中,邮件服务器中通过域来提供邮件服务。通常,域用户信息存储于(2)中。(1)A.WWW服
阅读以下Windows2003系统架构E-mail服务器的技术说明,根据要求回答问题1~问题5。【说明】某企业局域网内部基于WindowsServer2003操作系统提供的POP3服务和SMTP服务,架构了一台电子邮件服务器(IP地址为19
DNS的主要功能是什么,DNS解析域名的方式有哪些?顶级域名中,edu和com一般应用于什么组织?
DNS的主要功能是什么,DNS解析域名的方式有哪些?可以用什么命令测试域名服务器是否架设成功?
请根据图6-15网页的显示效果,解释该ASP程序中用下画线标出的语句的含义,即填写(1)、(3)、(4)、(6)、(10)空缺处的解释内容。请根据图6-15网页的显示效果,将ASP程序中(2)、(5)、(7)、(8)、(9)空缺处的代码补充完整。
在Server上进行NAT服务器配置时,若“接口2”的配置如图8-7所示,则其IP地址应设置为(1),子网掩码应设置为(2)。根据图8-6所示的拓扑结构中所给出的网络连接方式及相关的网络参数,计算机PCI得到的TCP/IP配置参数为:“IP地址
为了支持SNMP协议的管理功能,在基于WindowsServer2003操作系统的网络管理站中,需要进行哪些配置工作?若在图6-7的命令行中输入“snmputilget10.1.101.49public1”命令,系统将输出一个错误信息:Er
为了支持SNMP协议的管理功能,在基于WindowsServer2003操作系统的网络管理站中,需要进行哪些配置工作?对于图6-7所显示的系统输出信息,命令“snmputilwalk10.1.101.49public1”的作用是遍历被管理对
随机试题
近代紫砂陶艺人中最杰出的一位代表,被誉为“壶艺泰斗”、“一代宗师”的是
试运用历史唯物主义的基本原理,说明“三个代表”思想的理论基础和客观依据。
延伸卡环除固位之外,还具有
板蓝根可用于治疗()。
《城市道路交通规划设计规范》规定,城市道路交通综合网路规划的内容应包括()。
根据《票据法》的规定,下列各项中,属于汇票债务人可以对持票人行使抗辩权的事南是()。
利用金字塔式建仓策略时,持仓的增加应渐次递减。()
心智技能形成过程中各阶段顺序是()。
Intheworldtodayatleast(至少)twobabiesarebornineverysecond(秒).Bytheyear1998theworld’spopulationreached6bil
Organisedvolunteeringandworkexperiencehaslongbeenavitalcompaniontouniversitydegreecourses.Usuallyitisleftto【C
最新回复
(
0
)