Here is what is required:
Create a new console application project and name it "Week1Lab_YourName".
Create a new class called DayOfTheWeek. The class should have a data member that can store the day of the week such as Mon for Monday, Tues for Tuesday etc...
STEP 2: Create the member functions
Create the necessary member functions that will perform the required operations outlined in the lab summary above.
Call these functions setDay, printDay and getDay.
STEP 3: Create a main() program
Write a main program that will instantiate two objects of the class DayOfTheWeek. Use these objects to test the various operations on this class.
Here is what I have so far, it does not compile. I'm sure it is a simple amatuer mistake but I am an amatuer trying to learn. Thanks in advance for any help.
#include <iostream>
#include <string>
using namespace std;
class dayOfTheWeek
{
public:
dayOfTheWeek(void); //Constructor
~dayOfTheWeek(void); //Destructor
void getDay(string&, string&);
void setDay(string, string);
void printday(string, string);
private:
string mon;
string tues;
};
dayOfTheWeek::dayOfTheWeek()
{
mon = "";
tues = "";
}
dayOfTheWeek::~dayOfTheWeek()
{
}
void dayOfTheWeek::setDay(string monday, string tuesday)
{
mon = monday;
tues = tuesday;
}
void dayOfTheWeek::getDay(string &monday, string &tuesday)
{
monday = mon;
tuesday = tues;
}
void dayOfTheWeek::printday(string monday, string tuesday)
{
monday = mon;
tuesday = tues;
cout << "The value of the object " << monday << " is : " << mon << endl;
cout << "the value of the object " << tuesday << " is : " << tues << endl;
}
int main()
{
dayOfTheWeek DayOne;
dayOfTheWeek DayTwo;
DayOne.setDay(monday, tuesday);
DayTwo.setDay(monday, tuesday);
string localMon = "";
string localTues = "";
DayOne.getDay(localMon);
DayTwo.getDay(localTues);
DayOne.printday(localMon);
DayTwo.printday(localTues);
return 0;
}