I am doing an assignment and I used if statements so many times, but today I got an error I don't know how to fix. I checked all my brackets and what not and yet I still don't know the problem. Please help!?! PS: The problems are on lines 62 and 78. Line 62 says "expected a statement" and Line 78 says " expected a }"
#include <iostream>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <string>
usingnamespace std;
int main()
{
constint DaysinJanuary = 31;
constint DaysinMarch = 31;
constint DaysinApril = 30;
constint DaysinMay = 31;
constint DaysinJune = 30;
constint DaysinJuly = 31;
constint DaysinAugust = 31;
constint DaysinSeptember = 30;
constint DaysinOctober = 31;
constint DaysinNovember = 30;
constint DaysinDecember = 31;
int Day, Year, DayNumber, DaysinFebruary;
string Month;
cout << "Welcome! This program will calculate the day number a given date is\nbased on its day, month and year." << endl << endl;
cout << "Please insert a year: " << endl;
cin >> Year;
cout << "Please insert a month by typing its name: " << endl;
cin >> Month;
cout << "Please insert a day number: " << endl;
cin >> Day;
cout << endl << endl;
if (Month == "January")
{
DayNumber = Day;
cout << "The day number for " << Month << Day << ", " << Year << " is number " << Day << ".";
}
elseif (Month == "February")
{
DayNumber = DaysinJanuary + Day;
cout << "The day number for " << Month << Day << ", " << Year << " is number " << Day << ".";
}
elseif (Month == "March")
{
if ((Year % 4 == 0 && Year % 100 != 0) || Year % 400 == 0)
{
DaysinFebruary = 29;
DayNumber = DaysinJanuary + DaysinFebruary + Day;
cout << "The day number for " << Month << Day << ", " << Year << " is number " << Day << ".";
}
else
{
DaysinFebruary = 28;
DayNumber = DaysinJanuary + DaysinFebruary + Day;
cout << "The day number for " << Month << Day << ", " << Year << " is number " << Day << ".";
}
elseif (Month == "April")
{
if ((Year % 4 == 0 && Year % 100 != 0) || Year % 400 == 0)
{
DaysinFebruary = 29;
DayNumber = DaysinJanuary + DaysinFebruary + DayinMarch + Day;
cout << "The day number for " << Month << Day << ", " << Year << " is number " << Day << ".";
}
else
{
DaysinFebruary = 28;
DayNumber = DaysinJanuary + DaysinFebruary + Daysin March + Day;
cout << "The day number for " << Month << Day << ", " << Year << " is number " << Day << ".";
}
return 0;
}//end main