Click here to Skip to main content
16,019,435 members

Comments by Member 13525421 (Top 4 by date)

Member 13525421 19-Nov-17 11:41am View    
Do you mind to tell me what I should put for leap year?
Member 13525421 19-Nov-17 11:40am View    
I know the main method is wrong because it keeps saying "cant load main method".. but as a newbie no, I don't know what to do.
Member 13525421 16-Nov-17 16:06pm View    
I appreciate your help so incredibly much. Thank you for your time!
Member 13525421 16-Nov-17 16:05pm View    
I copied what you left and pasted it to run but it still says the same thing. Here is what I tried to run..

#include <iostream>
using namespace std;

int main()
{

//Variables

int month;
int year;
bool leapYear = false; //<- C++ ha 'bool', not 'boolean'
//int checkLeapyear; <- commented out because unused

//Where user enters a month

cout << "Enter a month" << endl; //<- is 'endl' not 'end1'
cin >> month;

//Where user enters year
cout <<"Enter a year" << endl; //<- is 'endl' not 'end1'
cin >> year;

if (month == 1){ // removed a spurious '/' here
cout << "January " << year << " has 31 days " << endl;//<- is 'endl' not 'end1';
}
else if (month == 2 && leapYear == true){
cout << "February " << year << " has 29 days " << endl;//<- is 'endl' not 'end1';
}
else if (month == 2 && leapYear == false){
cout << "Febuary " << year << "has 28 days " << endl;//<- is 'endl' not 'end1';
}
else if (month == 3){
cout << "March " << year << "has 31 days " << endl;//<- is 'endl' not 'end1';
}
else if (month == 4){//<- added a missing '('
cout << "April " << " has 30 days " << endl;//<- is 'endl' not 'end1';
}
else if (month == 5){
cout << "May " << year << "has 31 days " << endl;//<- is 'endl' not 'end1';
}
else if (month == 6){
cout << "June " << year << " has 30 days " << endl;//<- is 'endl' not 'end1';
}
else if (month == 7){
cout << "July " << year << "has 30 days " << endl;//<- is 'endl' not 'end1';
}
else if (month == 8){
cout << "August " << year << "has 31 days " << endl;//<- is 'endl' not 'end1';
}
else if (month == 9){
cout << "September " << year << " has 30 days " << endl;//<- is 'endl' not 'end1';
}
else if (month == 10){
cout << "October " << year << "has 31 days" << endl;//<- is 'endl' not 'end1';
}
else if (month == 11){
cout << "November " << year << "has 30 days" << endl;//<- is 'endl' not 'end1';
}
else if (month == 12){
cout << "December " << year << "has 31 days" << endl;//<- is 'endl' not 'end1';
}
else{
cout << "Invalid Month" << endl;//<- is 'endl' not 'end1';
}
return 0;
}