mardi 19 novembre 2019

Trying to create a calendar using switch and if statement to check user input then outputs the day

so I'm trying to create a calendar that asks for the user's chosen month and date numerically using switch statement and then I tried to use if statement to check the user's date input and if it matches it displays the day. so here is my code

void UserInput()
{
cout << "\nPlease enter a numerical value of a month e.g. May=5, December=12: \n";
cin >>  Month;

cout << "\nPlease enter a Date: \n";
cin >>  Date;
}

void MagicCalendar()
{
switch(Month)
{
case 1:
if(Date == 6 || 13 || 20 || 27)
{
cout << " It's Sunday!!!";
break;
} 
if(Date == 7 || 14 || 21 || 28 )   <-- the problem is probably here idk if its the operand or the if statement itself
{
cout << " It's a MOFO MONDAY GO KYS NOW!";
break;
}
else if(Date ==)
{
cout << " It's a Tuesday and kinda like a monday but yeah...";
break;
}
else if(Date ==)
{
cout << " It's Wednesday and I know that you can feel it!";
break;
}
else if(Date ==)
{
cout << " It's a THURSDAY!! getting warmer :D";
break;
}
 else if(Date ==)
{
cout << " It's FRIDAY!! GO GET SHITFACED YOU DESERVE IT :D";
break;
}
else if(Date ==)
{
cout << " It's SATURDAY BABY! go cry in a corner while suffering from Hungover...";
break;
}
break;

} }

Aucun commentaire:

Enregistrer un commentaire