Date Class

已取消 已发布的 Sep 24, 2015 货到付款
已取消 货到付款

Objective: This assignment will provide further practice with implementing classes.

Task: For this homework, you will write a class called Date, in the files date.h and [login to view URL], for creating and using objects that will store valid dates of the year.

This class should be portable, so it should work with any up-to-date C++ compiler. Make sure that it works with g++ before you hand it in. You should write some test programs of your own to test the functionality of the class.

Program Details and Requirements:

1) An object of type Date should represent a calendar date in terms of month, day, and year, as on a 12-month A.D. calendar. The valid months are January through December, a valid day must correspond to a valid day for the given month, and the year must be a positive number. Your object should also store a format setting, to be used for display of dates to the screen. There will be more than one possible format. The class features (public interface) should work exactly as specified, regardless of what program might be using Date objects.

Note: For purposes of easy input (from keyboard or into functions), date values will be specified with integers. Month values will be 1 for January, 2 for February, etc... on to 12 for December. A valid day value will be an integer between 1 and the number of days in the month. Valid year values are positive numbers.

2) Your Date class must provide the following services (i.e. member functions) in its public section. These functions will make up the interface of the Date class. Make sure you use function prototypes as specified here. (You may write any other private functions you feel necessary, but the public interface must include all the functionality described here).

the constructor(s):

The Date class should have a constructor that allows the user to specify the values for the month, day, and year, using integer values, when the object is declared. If any of the values would result in an invalid date, the constructor should throw out the erroneous information and initialize the object to represent 1/1/2000 (January 1, 2000) instead. Also, you should allow a Date object to be declared without specified values, in which case it should initialize to 1/1/2000 also.

Examples: These declarations should be legal, and the comment gives the initialized date

Date d1; // initializes to Jan 1, 2000

Date d2(3,4,1992); // initializes to March 4, 1992

Date d3(13,30,1990); // invalid month, initializes to Jan 1, 2000 instead.

The rest is accessible from here: [login to view URL]~myers/cop3330/hw/[login to view URL]

C++编程 软件构架 软件测试 网站管理

项目ID: #8542710

关于项目

6个方案 远程项目 活跃的Sep 24, 2015

有6名威客正在参与此工作的竞标,均价$129/小时

dobreiiita

Hello I am C++ expert and interested in this project. I have reviewed the requirements carefully and confident to handle this project perfectly. I also have a lot of experience in helping students with assignments. 更多

$100USD 在1天里
(275条评论)
7.0
needoCh

Hi, I am Software Engineer. I have skills in Desktop Application Development, Android Development, Databases, Web development and Graphics Designing. I have experience with C/C++, C#, Java, Visual Basic, SQL/MySQL, HT 更多

$100 USD 在3天内
(22条评论)
4.3
cruizv

Expert in use of C++ language. This cost is to develop all general requirements + leap years. If you need extra B (Julian day), I could do this for $10 more. Is delivered with a tester in 1 day.

$83USD 在1天里
(1条评论)
2.0
lancelotjs

A proposal has not yet been provided

$155 USD 在3天内
(0条评论)
0.0
thang0207

Đề xuất vẫn chưa được gửi

$111 USD 在5天内
(0条评论)
0.0