C++ Date with bonus question Workshop 4 OOP244 - 88367

Solution Posted by
jordanblink

jordanblink

Rating : (19)A+
Solution Detail
Price: $30.00
Request Description
C++ Date with bonus question Workshop 4 OOP244 Design and code a class named Date that holds information about a date in a calendar. Place your class definition in a header file named Date.h and your function definitions in an implementation file named Date.cpp. Include in your coding all of the statements necessary for your code to compile under a standard C++ compiler. The class Date has the following four member variables: • A null-terminated C-style string holding the name of the person with whom the date is booked. You may assume that the string is no larger than 30 characters, excluding the null terminator • Year of the date. • Month of the date. • Day of the date. Include two constructors in your definition: a no-argument constructor that sets the object to a safe empty state and a four-argument constructor that receives the address of the C-style string containing the name, year, month, and the year of the date. Note that you must check the validity of users’ input. If no arguments are provided, or validation fails, the object is set to a safe empty state. Your design includes the following member functions: • void book(const char* name, int year, int month, int day) - a modifier that stores valid data in an Date object. The first parameter receives the address of a C-style string that holds the name of the person you book a date with. The second, third and fourth parameters hold the year, month, and day of the date. • bool isAvailable() const - a query that checks if a certain date is available to book. If the date is available, this function returns true and false otherwise. • void cancel() - a modifier that cancels the date. • bool hasConflict(const Date &date) const - a query that accepts an unmodifiable reference to a new date and checks if two dates have a conflict. Two dates have a conflict if they have the same year, month, and day. • void display() const - a query that displays the name as well as the date of the date. This function returns an error message if the date does not exist.
Solution Description

Design and code a class named Date that holds information about a date in a calendar. Place your class definition in a header file named Date.h and your function definitions in an implementation file named Date.cpp.  Include in your coding all of the statements necessary for your code to compile under a standard C++ compiler.

The class Date<

Attachments
CPPConstructors.zip
CPPConstructors...
CPPConstructorsBonus.zip
CPPConstructors...