首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。 【说明】 下面程序的功能是计算并输出某年某月的天数,函数IsLeap Year()能够判断是否是闰年。 【C++程序】 # include < iostream > using namespa
阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。 【说明】 下面程序的功能是计算并输出某年某月的天数,函数IsLeap Year()能够判断是否是闰年。 【C++程序】 # include < iostream > using namespa
admin
2009-05-15
18
问题
阅读以下说明和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) ( );
}
选项
答案
(2)m_ month<Jan||m_ month>Dec
解析
当输入参数m_ month不合法时,将私有变量初始化为Jan。
转载请注明原文地址:https://jikaoti.com/ti/pPW7FFFM
本试题收录于:
程序员上午基础知识考试题库软考初级分类
0
程序员上午基础知识考试
软考初级
相关试题推荐
以下(1)是WindowsServer2003的Internet信息服务(IIS)管理器新增的服务功能。在WindowsServer2003操作系统中,邮件服务器中通过域来提供邮件服务。通常,域用户信息存储于(2)中。(1)A.WWW服
以下(1)是WindowsServer2003的Internet信息服务(IIS)管理器新增的服务功能。在WindowsServer2003操作系统中,邮件服务器中通过域来提供邮件服务。通常,域用户信息存储于(2)中。(1)A.WWW服
阅读以下Windows2003系统架构E-mail服务器的技术说明,根据要求回答问题1~问题5。【说明】某企业局域网内部基于WindowsServer2003操作系统提供的POP3服务和SMTP服务,架构了一台电子邮件服务器(IP地址为19
客户小郭要求将其计算机通过电话线宽带接入Internet,则小郭的计算机通常需要添加哪些外部网络设备?除此之外,小郭还需从网络服务提供商(ISP)获得哪些信息才能宽带接入到Internet?结合图1-12、图1-13的系统输出信息,图1-11拓扑结构中
客户小郭要求将其计算机通过电话线宽带接入Internet,则小郭的计算机通常需要添加哪些外部网络设备?除此之外,小郭还需从网络服务提供商(ISP)获得哪些信息才能宽带接入到Internet?客户小郭已经获知电子商务公司A网站服务器的IP地址。小郭可以在
在一台计算机上安装完成WindowsServet2003服务器及相应的服务组件。网络中有一台客户机只安装了TCP/IP协议,能够通过网上邻居看到局域网内其他客户机和服务器,但无法访问Internet(通过IP地址也不行),但其他客户却可以,请问最有
DNS的主要功能是什么,DNS解析域名的方式有哪些?DNS服务器有几种类型,分别是什么?
先阅读以下说明,然后将空白处的语句补充完整。[说明]以下是HTML语言的部分代码,其中,符号“//”表示该行的注释,请根据注释写出其内容。<html><head><bgsound>(1)//表示指向一个与该网页
根据图6-14网页的显示效果图,请将index01.asp文件中(1)~(7)空缺处的内容填写完整。以下是该出版社用户登录页面(参考图6-14网页的右上角)的部分代码,基本功能是检测用户是否填写用户名,如果没有填写,将跳出提示错误的窗口,否则提交用户信
在Server上进行NAT服务器配置时,若“接口2”的配置如图8-7所示,则其IP地址应设置为(1),子网掩码应设置为(2)。在WindowsServer2003操作系统中,可以通过服务器角色配置图8-6代理服务器的DHCP服务组件。在配置该企业内
随机试题
背景某港口新建一消防泵站内包含40000m3消防水池工程,消防水池一半位于地面以下一半位于地面以上,整体钢筋混凝土板式基础,四周全现浇混凝土剪力墙,全部采用C30P12抗渗混凝土浇筑成型。由于水池在整个港口消防工程中的重要地位,在混凝土自防水基础上,内
国际金本位制的类型包括【】
患者,男,68岁。右下牙龈癌,拟行颌颈联合根治术加胸大肌、肋骨复合组织瓣修复术。该块骨肌皮瓣所带的肋骨源于哪一肋
气雾剂给药剂量的准确性受哪一项的直接影响
FIDIC施工条件规定,承包商租赁施工设备时,应在租赁协议中规定在协议有效期内发生承包商违约解除合同时,设备所有人应( )。
中华人民共和国的一切权力属于()。
预防骨质疏松症的主要措施有()。[湖北省2010年5月三级真题]
构图的基本法则是__________、__________、__________、尺度、__________、稳定、__________、韵律。
我国社会主义道德建设的核心是为人民服务。()
Youshould___________(充分利用)thisvaluableopportunity.
最新回复
(
0
)