Question

//Please help me out with this problem.. This problem has to be done in C++ and has to strictly follow the instructions... I have given the expected output of the problem
below.  1) Design a class Date: Provide 3 instance variables (int) to store the month, the day number, and the year Provide the following functions Default constructor -sets date to, 1500 Constructor with parameters - if parameters are not valid, set like default constructor setDate if parameters are not valid, set like default constructor Accessors for each instance variable Mutators for each instance variable if parameter is not valid set like default constructor Return the next day Return the previous day Calculate and return the day by adding a number of days to the current day. Examples: if the current day is Monday and we add 4 days, the day to return is Friday; if the current day is Tuesday and we add 13 days, the day to return is Monday Print a date in the form mm-dd-yyyy Print a date with the month as a string (ex: March 20, 2010) isLeap-t Return the number of days in the month Return the number of days passed in the year from the current date Return the number of days remaining in the year from the current date Calculate a new date by adding a fixed number of days to the date Print the calendar for the particular month (can print a calendar for any month starting January 1, 1500 · test whether the year is a leap year Note that the day for January 1 of the year 1500 was a Monday. To calculate the first day of the month, you can add the appropriate number of days to Monday, January 1, 1500.) For example, the calendar for September 2014 should be printed as: September 2014 Sun MonTueWed Th Fri Sat 10 17 24 13 20 27 11 12 15 21 23 25 26

0 0
Add a comment Improve this question Transcribed image text
Answer #1

w Project Date.cpp 1 class Date 2 private: int day int month int year public: Date() day 1; month-1 year 1500 10 12 13 14 15TOM-Gcc 4.9-2 66-bit Release Date.cpp 26 27 28 29 30 31 32 setbate(int d,int m,int y) this.day-d; this.month m this.year-ys 3earch View Window Hel (globals) ses Debug Date.cpp 60 61 62 63 64 65 void setMonth(int m) this.month m 67 else month-1; 69 FDate.cpp 94 95 96 97 98 e Sunday, 1 for Monday and so on int addDays (int days) 9 static int tIl- (e,3,2,5,0,3,5,1,4,6,2,4)sDate.cpp 109 111부 110 if (year%4-4) 112 113 114 115 116 if (year% 100-.8) if(year%400 :-0) return true; else 118 119 120 121

Add a comment
Know the answer?
Add Answer to:
//Please help me out with this problem.. This problem has to be done in C++ and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Design and implement a C++ class called Date that has the following private member variables month...

    Design and implement a C++ class called Date that has the following private member variables month (int) day (nt) . year (int Add the following public member functions to the class. Default Constructor with all default parameters: The constructors should use the values of the month, day, and year arguments passed by the client program to set the month, day, and year member variables. The constructor should check if the values of the parameters are valid (that is day is...

  • C++ problem 11-6 In Programming Exercise 2, the class dateType was designed and implemented to keep...

    C++ problem 11-6 In Programming Exercise 2, the class dateType was designed and implemented to keep track of a date, but it has very limited operations. Redefine the class dateType so that it can perform the following operations on a date, in addition to the operations already defined: Set the month. Set the day. Set the year. Return the month. Return the day. Return the year. Test whether the year is a leap year. Return the number of days in...

  • please help ASAP need to complete soon needs to be done in C programing void countDays...

    please help ASAP need to complete soon needs to be done in C programing void countDays (unsigned month, unsigned day): Given a month and day, print a message based on the following conditions (which we would suggest testing in order). Don't get overwhelmed by the number of conditions--the function gets a bit long, but the function body shouldn't be that complex: • If the month is invalid, print Invalid month: followed by the month argument (for example, Invalid month 13)...

  • Use Java please Creating a calendar for a given year A shell for this assignment has...

    Use Java please Creating a calendar for a given year A shell for this assignment has been provided so that you can fill in the methods Homework 4 grading rubric 1. Output examples a. One Normal Year, 10% b. One Leap Year, 10% 2. Style Meaningful variable names, 10% b. Meaningful method names, 10 % c. Comments, Total: 10% . Do not comment every line. 5% . Comment non-obvious code. 5% a d. Indentation, 10% e. Block comment with name...

  • Please create a C++ class called myDate. It should have the following operations: myDate() – default...

    Please create a C++ class called myDate. It should have the following operations: myDate() – default constructor. This will set the date to May 10, 1959. myDate(int M, int D, int Y) – overloaded constructor. This will set the date to the values passed in through the parameter list represented by Month, Day and Year. void display() – display the date in the following format (May 11, 1959) Do NOT print a linefeed after the date. void incrDate(int N) –...

  • SaffSpring 2019 Professor Question 1: Answer ALL of the following questions based on this provide...

    I need sub-questions e, f, g, h. SaffSpring 2019 Professor Question 1: Answer ALL of the following questions based on this provided int daya int montha Date int dnt int y day-d year class Event ring locatson eventbat Event (5tring , Dated ocatlon- event Date-d pubiie String toStringt String detalla-Locatlons"LocatlonDatesevent Date.day return detalia eventDate-year publie statie weld mai arg Event 2ew EventCBayan" hew Date1.3,20191 Systen.out peintil The event n (11.201,as scheduled-ee . 내 1 eentDate.yeari ystem.st-printeinte yatem.ost-printcin(e2) a) What is...

  • please help me with this in C# language. Constructors The goal for this exercise is to...

    please help me with this in C# language. Constructors The goal for this exercise is to understand what constructors are, how to define them, and how to call them, including ‘default’ constructors, and including the use of overloading to provide multiple constructors. One of the advantages of having a clear separation between the public interface of an object and private internal implementation of an object is that once you've got the data in the object you can then ask the...

  • public class Date { private int month; private int day; private int year; /** default constructor...

    public class Date { private int month; private int day; private int year; /** default constructor * sets month to 1, day to 1 and year to 2000 */ public Date( ) { setDate( 1, 1, 2000 ); } /** overloaded constructor * @param mm initial value for month * @param dd initial value for day * @param yyyy initial value for year * * passes parameters to setDate method */ public Date( int mm, int dd, int yyyy )...

  • Please write the program in C++ Problem Description: Design a class called Date. The class should...

    Please write the program in C++ Problem Description: Design a class called Date. The class should store a date in three integers: month, day, and year.     Create the necessary set and get methods.       Design member functions to return the date as a string in the following formats:                                     12/25/2012                                     December 25, 2012                                     25 December 2012 Input Validation: Do not accept values for day greater than 30 or less than 1. Do not accept values for month...

  • Complete the SpeedDating Class Write the method bodies for the 2 SpeedDating methods. Study the method...

    Complete the SpeedDating Class Write the method bodies for the 2 SpeedDating methods. Study the method declarations and Javadoc comments so that you understand what each method is supposed to do. To receive credit for a method, it must use one of the Java loops (your choice). Nested loops are not necessary. Write a Test Class for Your SpeedDating Class Your test class will have a main method that does the following: Create a SpeedDating object Since 1971, Columbus Day...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT