1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
int main()
{
//enum daysEnum {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, total};
//DayOfTheWeek::daysEnum;
//_____You don't actually use these
DayOfTheWeek day;
// Set the values of the objects
day.setDay("Monday"); //_____Do you really need an object for each day?
// Get the value of the monday object and print it out
//string currentDay = day.getDay();
//cout << "The value of the monday object is " << currentDay << "." << endl;
cout << "The value of the monday object is " << day.getDay() << "." << endl;
//_____You could just use the get function within the cout
int today;
int tomorrow;
int yesterday;
today = day.toNumber("Monday");
cout << today << endl;
tomorrow = today + 1;
yesterday = today - 1;
cout << "The day before was: ";
day.toName(yesterday); //_____Use the object to call the function in the class ( day. )
cout << endl;
cout << "The day after is: " ;
day.toName(tomorrow) ;
cout << endl;
int currentDay2 = today + 3;
int currentDay3 = today - 3;
currentDay3 = today % 7;
cout << "Monday + 3 = " ;
day.toName(currentDay2);
cout << endl << "The value for the monday object is still monday" << endl;
cout << "Monday - 3 = ";
day.toName(currentDay3); //_____You need to code a loop around.
//_____
//_____enum daysEnum {
//_____Sunday = 0,
//_____Monday = 1,
//_____Tuesday = 2,
//_____Wednesday = 3,
//_____Thursday = 4,
//_____Friday = 5,
//_____Saturday = 6,
//_____total = 7};
//_____
//_____1 - 3 = -2
//_____You need to code it so that 1 - 3 = 5
return 0;
}
|