Data works

Selesai Dipasang Nov 18, 2014 Dibayar saat pengiriman
Selesai Dibayar saat pengiriman

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.

Pemrograman C++

ID Proyek: #6750578

Tentang proyek

8 proposal Proyek online Aktif Nov 19, 2014

Diberikan kepada:

maoo92

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 dalam 1 hari
(17 Ulasan)
3.9

8 freelancer rata-rata menawar $25 untuk pekerjaan ini

Yknox

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 serv Lebih banyak

$35 USD dalam 1 hari
(622 Ulasan)
8.8
juniadsarfraz

JAVA and C++ EXPERT here. Very EASY to me. Contact me ASAP. I can do this. Regards, Junaid

$35 USD dalam 1 hari
(50 Ulasan)
5.9
MukrramBajwa

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 dalam 1 hari
(3 Ulasan)
2.2
Nomakram1

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 forwar Lebih banyak

$20 USD dalam 1 hari
(5 Ulasan)
1.9
danieldogaru365

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 ni Lebih banyak

$25 USD dalam 0 hari
(0 Ulasan)
0.0
meelan2309

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 dalam 1 hari
(0 Ulasan)
0.0
wokdev

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 dalam 1 hari
(0 Ulasan)
0.0