Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

int main ( ) { std::string month; int day; std::cin > > month > > day; if ( ( month = = March && day

int main(){
std::string month;
int day;
std::cin >> month >> day;
if ((month == "March" && day >=20)||(month == "April")||(month == "May")||(month == "June" && day <=20)){
std::cout << "Spring" << std::endl;
} else if ((month == "June" && day >20)||(month == "July")||(month == "August")||(month == "September" && day <=21)){
std::cout << "Summer" << std::endl;
} else if ((month == "September" && day >21)||(month == "October")||(month == "November")||(month == "December" && day <=20)){
std::cout << "Autumn" << std::endl;
} else if ((month == "December" && day >20)||(month == "January")||(month == "February")||(month == "March" && day <=19)){
std::cout << "Winter" << std::endl;
} else {
std::cout << "Invalid" << std::endl;
}
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Do you think physicians should have unions? Why or why not?

Answered: 1 week ago