Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING C++ AND Months must be 1 thru 12. Days must be 1 thru the valid last day of a specific month. For example, the

USING C++

AND

Months must be 1 thru 12.

Days must be 1 thru the valid last day of a specific month. For example, the last day of Jan is 31, of Feb is 29, and of Apr is 30, etc.

In the output, display months using the actual names such as January is desirable but not required.

The following algorithm yields the season (Spring, Summer, Fall, or Winter) for a given month and day.

image text in transcribed

If month is 1, 2, or 3, season = "Winter" 
Else if month is 4, 5, or 6, season = "Spring" 
Else if month is 7, 8, or 9, season = "Summer" 
Else if month is 10, 11, or 12, season = "Fall" 
If month is divisible by 3 and day >= 21
 If season is "Winter", season = "Spring" 
 Else if season is "Spring", season = "Summer" 
 Else if season is "Summer", season = "Fall" 
 Else season = "Winter" 

Write a program that prompts the user for a month and day and then prints the season, as determined by this algorithm.

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

Step: 3

blur-text-image

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

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions

Question

What is the environment we are trying to create?

Answered: 1 week ago

Question

How would we like to see ourselves?

Answered: 1 week ago

Question

How can we visually describe our goals?

Answered: 1 week ago