Question: General requirements : - No global variables - No multiple return statements in one function - Show how you have tested these functions - cin

General requirements: - No global variables - No multiple return statements in one function - Show how you have tested these functions - cin and cout are not allowed in these classes. They can only be in main() or testing functions - These classes should not provide the default constructor. - Show how these classes being used to create objects and how these methods are being called and return proper values. Note: this is an exercise to define and use C++ classes, objects and methods.

Question #2: Define a C++ class named "WeeklyTask" that manages a task name (string) and a day in a week (1 through 7 where 1 is Sunday and 7 is Saturday).

It should provide at least the following three methods: "isBusy" method to compare with another WeeklyTask object and return true if both has the same week day and false otherwise. "contains" method that accepts a search string and returns true if the task contains that search string and false otherwise. "toString" that returns a string represents the WeeklyTask object in the following format of "TASK(name) DAY()" such as "TASK(Go to school) DAY(Monday)" or "TASK(Pay bill) DAY(Tuesday)" or "TASK(Buy grocery) DAY(Saturday)"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!