Question: int getDay( int day) { cout < < What day of the week is it? < < endl < < 0-Sun < < 1-Mon

int getDay(int day)

{

cout << "What day of the week is it? " << endl <<

"0-Sun" << "1-Mon " << "2-Tues " << "3-Wed " << "4-Thurs " <<

"5-Friday " << "6-Sat ";

cin >> day;

if(day >= 0 || day <=6)

{

return day;

}

else

{

int getDay(int day);

}

}

string setDay(int day)

{

Days d1;

cout << d1.days[day];

}

I want to pose the question of the day, have the user return a value based upon the day and then set the value as the position of the array in another function. How do I carry the value over with the same variable? thank you

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 Databases Questions!