Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started