文件名称:exp3
- 所属分类:
- 其他小程序
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2013-09-25
- 文件大小:
- 1.23mb
- 下载次数:
- 0次
- 提 供 者:
- w*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
理解和掌握运算符重载,了解静态变量和const成员函数。
实验内容:
(1)设计一个名为Date的日期类,完成基本的日期处理功能。
(2)扩充实例编程中的日期类,为Date类增加一个成员函数,可以判断一个日期是否是系统的当前日期。从键盘输入你的生日,如果今天是你的生日则显示“HappyBirthday!”,否则显示“还有XX天是你的生日”或“你的生日已经过去了XX天,明年的生日要再等YY天”。
(3)仿照Date类设计一个Time类,设计多个重载的构造函数,可以设置时间、进行时间的加减运算、按各种可能的格式输出时间。-Understand and master operator overloading, understanding static const member variables and functions. Experiment: (a) Design a class named Date date, the completion date of the basic processing functions. (2) extend the date in the class examples of programming for the Date class adds a member function, you can determine whether a date is the system' s current date. From the keyboard to enter your birthday, if today is your birthday is displayed " HappyBirthday!" , Otherwise " there is your birthday XX days" or " your birthday has passed after XX days next year' s birthday have to wait YY days. " (3) Design a class modeled Date Time class, designing several overloaded constructors, you can set the time for time of addition and subtraction, according to a variety of possible formats output time.
实验内容:
(1)设计一个名为Date的日期类,完成基本的日期处理功能。
(2)扩充实例编程中的日期类,为Date类增加一个成员函数,可以判断一个日期是否是系统的当前日期。从键盘输入你的生日,如果今天是你的生日则显示“HappyBirthday!”,否则显示“还有XX天是你的生日”或“你的生日已经过去了XX天,明年的生日要再等YY天”。
(3)仿照Date类设计一个Time类,设计多个重载的构造函数,可以设置时间、进行时间的加减运算、按各种可能的格式输出时间。-Understand and master operator overloading, understanding static const member variables and functions. Experiment: (a) Design a class named Date date, the completion date of the basic processing functions. (2) extend the date in the class examples of programming for the Date class adds a member function, you can determine whether a date is the system' s current date. From the keyboard to enter your birthday, if today is your birthday is displayed " HappyBirthday!" , Otherwise " there is your birthday XX days" or " your birthday has passed after XX days next year' s birthday have to wait YY days. " (3) Design a class modeled Date Time class, designing several overloaded constructors, you can set the time for time of addition and subtraction, according to a variety of possible formats output time.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
exp3
....\3.dsp
....\3.dsw
....\3.ncb
....\3.opt
....\3.plg
....\Date.cpp
....\Date.h
....\Debug
....\.....\3.exe
....\.....\3.ilk
....\.....\3.pch
....\.....\3.pdb
....\.....\Date.obj
....\.....\main.obj
....\.....\Time.obj
....\.....\vc60.idb
....\.....\vc60.pdb
....\main.cpp
....\Time.cpp
....\Time.h