#include <iostream>
int main(todaysDate, numberOfSchoolDaysLeftUntilSummer)
{
//Below are two strings that can hold several char variables
char todaysMonth[10];
char lastMonthOfSchool[10];
//Below are variables where the month will be written in number //form.
//The char variables are converted into integers so numerical //calculations on the months can be performed.
short numberMonth = 0;
short numberLastMonth = 0;
short monthsLeft;
std::cout << "What is the month of today\t?";
std::cin >> todaysMonth;
std::cout << "\nWhat month does school end?\t";
std::cin << lastMonthOfSchool;
switch (todaysMonth)
{
case january:
numberMonth + 1;
break;
case february:
numberMonth + 2;
break;
case march:
numberMonth + 3;
break;
case april:
numberMonth + 4;
break;
case may:
numberMonth + 5;
break;
case june:
numberMonth + 6;
break;
case july:
numberMonth - 6;
break;
case august:
numberMonth - 5;
break;
case september:
numberMonth - 4;
break;
case october:
numberMonth - 3;
break;
case november
numberMonth - 2;
break;
case december:
numberMonth - 1;
break;
case default:
std::cout << "\nError: Please try again and enter a month without any capital letters";
}
switch (lastMonthOfSchool)
{
case january:
numberLastMonth + 1;
break;
case february:
numberLastMonth + 2;
break;
case march:
numberLastMonth + 3;
break;
case april:
numberLastMonth + 4;
break;
case may:
numberLastMonth + 5;
break;
case june:
numberLastMonth + 6;
break;
case july:
numberLastMonth - 6;
break;
case august:
numberLastMonth - 5;
break;
case september:
numberLastMonth - 4;
break;
case october:
numberLastMonth - 3;
break;
case november
numberLastMonth - 2;
break;
case december:
numberLastMonth - 1;
break;
case default:
std::cout << "\nError: Please try again and enter a month without any capital letters.";
}
//The statement below calculates how many months are left
numberLastMonth - numberMonth = monthsLeft;
//If the statement above assigns the variable monthsLeft a negative //number, then the statement below makes it the correct, positive //number
if (monthsLeft < 0)
{
switch (monthsLeft)
{
case = -1:
monthsLeft + 1;
break;
case = -2:
monthsLeft + 4;
break;
case = -3:
monthsLeft + 6;
break;
case = -4:
monthsLeft + 8;
break;
case = -5:
monthsLeft + 10;
break;
case = -6:
monthsLeft + 12;
break;
case = -7:
monthsLeft + 14;
break;
case = -8:
monthsLeft + 16;
break;
case = -9:
monthsLeft + 18;
break;
case = -10:
monthsLeft + 20;
break;
case = -11:
monthsLeft + 22;
break;
case = -12:
monthsLeft + 24;
break;
case default:
std::cout << "\nError: Please try again and enter a month.";
break;
}
}
//These are the variables that store today's date and the date of the //last day of school
short todaysDate;
short lastDate;
int daysLeftEstimate;
if (monthsLeft<=2)
{
std::cout << "\nEnter in today's date\t";
std::cin >> todaysDate;
std::cout << "\nEnter in the date of the last day of school\t";
std::cin >> lastDate;
monthsLeft * 20 = daysLeftEstimate;
lastDate - todaysDate -((lastDate - todaysDate)/7*2) = numberOfSchoolDaysLeftUntilSummer;
}
if (monthsLeft <= 5 && monthsLeft >= 3)
{
std::cout << "\nEnter in today's date\t";
std::cin >> todaysDate;
std::cout << "\nEnter in the date of the last day of school\t";
std::cin >> lastDate;
monthsLeft * 18.8 = daysLeftEstimate;
lastDate - todaysDate -((lastDate - todaysDate)/7*2) = numberOfSchoolDaysLeftUntilSummer;
}
if (monthsLeft = 6)
{
std::cout << "\nEnter in today's date\t";
std::cin >> todaysDate;
std::cout << "\nEnter in the date of the last day of school\t";
std::cin >> lastDate;
monthsLeft * 18.17 = daysLeftEstimate;
lastDate - todaysDate -((lastDate - todaysDate)/7*2) = numberOfSchoolDaysLeftUntilSummer;
}
if (monthsLeft = 7)
{
std::cout << "\nEnter in today's date\t";
std::cin >> todaysDate;
std::cout << "\nEnter in the date of the last day of school\t";
std::cin >> lastDate;
monthsLeft * 17.71 = daysLeftEstimate;
lastDate - todaysDate -((lastDate - todaysDate)/7*2) = numberOfSchoolDaysLeftUntilSummer;
}
if (monthsLeft = 8)
{
std::cout << "\nEnter in today's date\t";
std::cin >> todaysDate;
std::cout << "\nEnter in the date of the last day of school\t";
std::cin >> lastDate;
monthsLeft * 18.25 = daysLeftEstimate;
lastDate - todaysDate -((lastDate - todaysDate)/7*2) = numberOfSchoolDaysLeftUntilSummer;
}
std::cout << "\nThere are: " << numberOfSchoolDaysLeftUntilSummer << "days left until it is summer time. \n Estimation: \t" << daysLeftEstimation;
return 0;
}