Write a program called p4.py that asks the user for two integers representing the month [1,..., 12] and the day [1, 31] respectively. Your program should then output, which of the four seasons ("Winter", "Spring", "Summer", or "Fall") the entered date is in. .... You should use the following date ranges for each season: 1. Spring: March 20th to June 20th 2. Summer: June 21st to September 22nd 3. Fall: September 23rd to December 20th 4. Winter: December 21st to March 19th Hint: You can use logical operators 'and'/'or' to combine multiple Boolean expressions. Example: Enter month [1,12]: Enter day [1,31]: 19 It's Winter! Enter month [1,12]: 3 Enter day [1,31]: 21 ENG

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
8°C
Sunny
Write a program called p4.py that asks the user for two integers representing the month
[1,..., 12] and the day [1.. 31] respectively. Your program should then output, which of
the four seasons ("Winter", "Spring", "Summer", or "Fall") the entered date is in.
.....
You should use the following date ranges for each season:
1. Spring: March 20th to June 20th
2. Summer: June 21st to September 22nd
3. Fall: September 23rd to December 20th
4. Winter: December 21st to March 19th
Hint: You can use logical operators ‘and' / 'or' to combine multiple Boolean expressions.
Example:
Enter month [1,12]:
Enter day [1,31]: 19
It's Winter!
Enter month [1,12]: 3
Enter day [1,31]: 21
ENG
US
Transcribed Image Text:8°C Sunny Write a program called p4.py that asks the user for two integers representing the month [1,..., 12] and the day [1.. 31] respectively. Your program should then output, which of the four seasons ("Winter", "Spring", "Summer", or "Fall") the entered date is in. ..... You should use the following date ranges for each season: 1. Spring: March 20th to June 20th 2. Summer: June 21st to September 22nd 3. Fall: September 23rd to December 20th 4. Winter: December 21st to March 19th Hint: You can use logical operators ‘and' / 'or' to combine multiple Boolean expressions. Example: Enter month [1,12]: Enter day [1,31]: 19 It's Winter! Enter month [1,12]: 3 Enter day [1,31]: 21 ENG US
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr