The purpose of this lab is to give you practice writing a class in C++.
While you are gone for Spring Break you want to program your intelligent robot, the Tobor 3000, to do things for you around the house. The robot is given commands by creating a Tobor object. The Tobor class stores the date, time of day (in 24 hour format), and task that the robot should perform. Here is a sample main program:
int main() { // Create an array of Tobor objects. The default constructor is used for each object. // The default constructor should set the date to "Unknown date", the time to 0, and // the task to "Do nothing" Tobor vacation[4]; // Create three separate Tobor objects using the constructor to set the date, time, and task Tobor dog1("March 12",1200,"Feed dog"); Tobor dog2("March 13",1200,"Feed dog"); Tobor trash("March 12",2300,"Take out trash"); // Copy three of these objects into the array. // slot 2 is left with the object created by the default constructor vacation[0] = dog1; vacation[1] = trash; vacation[3] = dog2; // Output each task for the robot to do, and when for (int i = 0; i < 4; i++) { cout << "On " << vacation[i].getDate() << " at time " << vacation[i].getTime() << " Tobor will " << vacation[i].getTask() << endl; } }Write the Tobor class so this code will compile and run. The class should have three private variables:
The output of your program should look like this:
On March 12 at time 1200 Tobor will Feed dog On March 12 at time 2300 Tobor will Take out trash On Unknown date at time 0 Tobor will Do nothing On March 13 at time 1200 Tobor will Feed dogShow your code/program to the lab assistant for credit, or email to kjmock@alaska.edu by the end of the day for full lab credit.