Find Jobs
Hire Freelancers

Data works

$10-30 USD

已完成
已发布超过 9 年前

$10-30 USD

货到付款
Download the zipped project file [login to view URL] from the Homework Assignments area of Blackboard. 1. Define the public methods for the following class in a file date.h: // class representing a date class date { private: int month, day, year; bool leap; // true if a leap year void set_leap (); // sets the leap variable for the year public: date (); // constructor, creates a base date // sets a date to the given parameters date (int m, int d, int y); void operator++ (); // moves a date forward one day void print (); // prints the date in readable format bool new_year (); // true if date is January first // equality test for two dates bool equal (date d); // greater than test for two dates bool operator> (date d); // returns a date with largest components of two dates date operator% (date d); // friend that returns the greatest of three dates friend date great3 (date d1, date d2, date d3); }; • set_leap is a private member function that sets the value of the leap variable correctly for the year (true if it is a leap year, else false). A year will be a leap year if it is divisible by 4 but not by 100. If a year is divisible by 4 and by 100, it is a leap year if it is also divisible by 400. • date is an overloaded constructor. The no parameter version sets the date to January 1, 1, leap to false. The three parameter version sets the values of the private data variables representing the date equal to the values given by the three parameters. It also properly sets leap to true or false. • The overloaded operator ++ moves the date ahead one day. It should properly change to the next month and next year when appropriate. If a change is made to a new year, leap should be set correctly. print displays the date in the following format: month day, year month should be displayed as the month name. print should not print any linefeeds. • new_year returns true if the date is January first (the year does not matter). Else, it should return false. • equal returns true if the instance date is equal to the parameter date, else it returns false. Thus a sample call might be: [login to view URL] (your_date) which would return true if my_date is equal to your_date. • The overloaded operator > returns true if the first date is greater than the second, else it returns false. • The overloaded operator % returns a date with the largest component month, day and year for the given two dates. For example, it might include the month from the first and the day from the second. • great3 is a friend which returns the greatest of three given dates. It should work in cases when some or all of the dates are equal. There is an application [login to view URL] written for you. Your program should work for all possible situations not just those in the test program. My output for the application is shown here: d1 is January 1, 1 d2 is March 6, 1984 Number of days from d1 to d2: 724340 d2 is geater than d1 as it should be! d1 is March 6, 1984 d2 is March 7, 1984 d3 is March 6, 1984 Greatest of of d1, d2 and d3 is March 7, 1984 d4 is May 5, 1942 d5 is January 5, 1942 d6 is August 1, 1970 d4 > d5 d6 > d4 d6 > d5 Greatest of of d4, d5 and d6 is August 1, 1970 d7 is August 28, 1900 d8 is January 2, 1910 January 1, 1901 January 1, 1902 January 1, 1903 January 1, 1904 January 1, 1905 January 1, 1906 January 1, 1907 January 1, 1908 January 1, 1909 January 1, 1910 Number of days from d7 to d8: 3414 d9 is April 17, 1928 d10 is July 6, 1981 d11 is November 10, 1940 The date with largest components from d9 and d10: July 17, 1981 The date with largest components from d10 and d11 November 10, 1981 5 Points Extra Credit: Label every call in the application file with a comment indicating either member function, friend, or overloaded operator. Place your completed [login to view URL] and date.h files in the Homework 7 Assignment on Blackboard.
项目 ID: 6750578

关于此项目

8提案
远程项目
活跃9 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
I study computer science in college. Can get this job done in a few hours.4-5 tops. Study c++ for 8 years now. Look forward to hear from you.
$15 USD 在1天之内
5.0 (17条评论)
3.9
3.9
8威客以平均价$25 USD来参与此工作竞价
用户头像
Hello I'm interesting your project very well I'm a Good C/C++, Math, Algorithm expert. I understand your req exactly. I m quite well experienced in these assignment jobs. Let's go ahead with me I want to service for you continously. Thanks
$35 USD 在1天之内
4.9 (622条评论)
8.8
8.8
用户头像
JAVA and C++ EXPERT here. Very EASY to me. Contact me ASAP. I can do this. Regards, Junaid
$35 USD 在1天之内
5.0 (50条评论)
5.9
5.9
用户头像
Dear i have done a lot of work in it and also currently working on these type of projects. I will deliver you best quality work on time.
$23 USD 在1天之内
5.0 (3条评论)
2.2
2.2
用户头像
Respected Sir, Thank you for taking the time to read our initial posting. I have read initial project description and i am ready to start this project. For further details, please message in the pmb. Look forward to hearing from you. Thanks, Nomakram
$20 USD 在1天之内
3.8 (5条评论)
1.9
1.9
用户头像
Hello! I am experienced in C++ and after reading your project description, I can provide the work you need within a few hours or less. I would be glad to work for you. Please contact me if you are interested. Have a nice day!
$25 USD 在0天之内
0.0 (0条评论)
0.0
0.0
用户头像
I am a university student and have already coded bits of this code. i need to combine it for this project. I can get it done withing a few hours
$25 USD 在1天之内
0.0 (0条评论)
0.0
0.0
用户头像
hello I am computer science grad student. I have worked on something similar before and can finish this within a day. let me know if you would like me to work on this. cheers
$20 USD 在1天之内
0.0 (0条评论)
0.0
0.0

关于客户

UNITED STATES的国旗
Bronx, United States
5.0
4
付款方式已验证
会员自10月 17, 2014起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。