Answer to Question #313895 in C++ for Hassan

Question #313895

Write an instance method daysTillXmas that will be placed inside the Date class. The method returns how many days away the Date object is from Christmas, December 25, in the same year. For example, Nov. 22 is 33 days away, Sep. 3 is 113 days away, Dec 25 is 0 days away, and Dec 31 is -6 days away.


1
Expert's answer
2022-03-19T07:29:11-0400

Here is program:

class Date
{
public:
	void daysTillXmas(int date)
	{
		till = (365 - xmas) + date;
		cout << "Left until christmas - " << till << " days" << endl;
	}
private:
	int date;
	int xmas = 359;
	int till;
};

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog