文件名称:ep4
-
所属分类:
- 标签属性:
- 上传时间:2016-06-01
-
文件大小:3.74kb
-
已下载:7次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
北京理工大学面向对象程序设计第四次上机习题答案~-1. Define a class, DATE, including year, month and day and satisfy the demands as below:
1.1 Search keywords tm in the MSDN or internet to know how to get current date, and see also example on page 382 in the book or 405 in the E-book.
1.2 Define a derived class of DATE, BIRTHDAY, to save someone s birthday. The programmer calls the member function AGE to get someone s age.
1.3 So we can use like as follows in main:
void main()
{
BIRTHDAY Zhang(1988, 4, 15)
cout << Zhang.AGE() << endl // Now Zhang s age is 28
}
2. Define multiple classes(at least two classes) to pass data among them.
For example:you may define a class, such as InputData,to enter some data.
And define a class ,such as OutputData,to print some data.
Note:
2.1 Define any member data and member functions according to your program
2.2 DON T define global variable or object.
2.3 Further reflection: How can we deal with
1.1 Search keywords tm in the MSDN or internet to know how to get current date, and see also example on page 382 in the book or 405 in the E-book.
1.2 Define a derived class of DATE, BIRTHDAY, to save someone s birthday. The programmer calls the member function AGE to get someone s age.
1.3 So we can use like as follows in main:
void main()
{
BIRTHDAY Zhang(1988, 4, 15)
cout << Zhang.AGE() << endl // Now Zhang s age is 28
}
2. Define multiple classes(at least two classes) to pass data among them.
For example:you may define a class, such as InputData,to enter some data.
And define a class ,such as OutputData,to print some data.
Note:
2.1 Define any member data and member functions according to your program
2.2 DON T define global variable or object.
2.3 Further reflection: How can we deal with
(系统自动生成,下载前可以参看下载内容)
下载文件列表
ep4-1120141884-刘晶晶/ep4-2思考题.txt
ep4-1120141884-刘晶晶/exper4-1.cpp
ep4-1120141884-刘晶晶/exper4-2.cpp
ep4-1120141884-刘晶晶/exper4-3.cpp
ep4-1120141884-刘晶晶/exper4-4.cpp
ep4-1120141884-刘晶晶/exper4-1.cpp
ep4-1120141884-刘晶晶/exper4-2.cpp
ep4-1120141884-刘晶晶/exper4-3.cpp
ep4-1120141884-刘晶晶/exper4-4.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.