There is quite a few things that need to be changed and adjusted. A couple of em are just nit-picky, but the others are where you're getting your errors. Don't feel bad though, we have all made these mistakes.
First and foremost is your use of the modulus operator (%) and the values it's being used with. Because you are dealing with days of the year and not more explicit values, you should instead be using integers. Days of the year come in whole numbers. So first I would change all of your numerical types to integers. On that same note you 're defined' dayOfyear where you do the calculation. This is bad. Remember once you declare your variables you don't have to again. Finally you have to minus (-) signs in the calculation. You only need one.
CODE
// Calculate day of year
double dayOfYear = (dwi + dyi--1)%7;
// change it to
dayOfYear = (dwi + dyi-1)%7;
//if all of your numerical types are integers this should work fine.
Second is your use of a boolean value to handle erroeanous input. This is fine if you need it but in this case you don't. (unless your instructor requested it). Instead you can simply use your logical operators (||) to tie both of the if statments together and use an else instead. If you have to use it make sure you instanciate it to true.
CODE
/* this is perfectly legal */
if (( dwi < 0 || dwi > 6) || ( dyi < 1 || dyi > 366))
{
cout << "Invalid data, please try again." << endl;
}
else
{
//if-else if code here.
}
or if you have to use it make sure you do this.
CODE
bool numbersAreOK = true;
Finally when you use cin>> by itself like you are for input you should also use what's called cin.ignore(). cin takes only one character of information and leaves the 'enter key' in the input queue. This can cause problems. So after each of your cin>> statements try putting
CODE
cin.ignore();
. You should do this only after you run it for the first time so you can see the difference.
These won't hurt anything but you dont' need 2 cin.get() statements at the bottom and for the last option in the if-elseif to decide which day, you can just use an 'else'.
beyond that it looks pretty good! Keep up the good work and if you need anything else just drop in and ask.