1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kenny6666 [7]
1 year ago
11

Hello, I've tried everything and I cannot get this code to be fair. I need help. Can someone provide guidance so I can understan

d how to formulate the proper code for this question so I can understand how it should be set up in Python or Python #. Thanks truly. I really appreciate a response. Enjoy your day:
2.26 LAB: Seasons
Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an int to represent the day.

Ex: If the input is:

April
11
the output is:

Spring
In addition, check if the string and int are valid (an actual month and day).

Ex: If the input is:

Blue
65
the output is:

Invalid
The dates for each season are:
Spring: March 20 - June 20
Summer: June 21 - September 21
Autumn: September 22 - December 20
Winter: December 21 - March 19
Computers and Technology
1 answer:
Liula [17]1 year ago
5 0

A program that takes a date as input and outputs the date's season. The input is a string to represent the month and an int to represent the day is given below:

<h3>The Program</h3>

input_month = input()

input_day = int(input())

months= ('January', 'February','March', 'April' , 'May' , 'June' , 'July' , 'August' , 'September' , "October" , "November" , "December")

if not(input_month in months):

  print("Invalid")

elif input_month == 'March':

   if not(1<=input_day<=31):

       print ("Invalid")

   elif input_day<=19:

       print("Winter")

   else:

      print ("Spring")

elif input_month == 'April' :

   if not(1<=input_day<=30):

       print("Invalid")

   else:

      print("Spring")

elif input_month == 'May':

   if not(1<=input_day<=31):

       print("Invalid")

   else:

       print("Spring")

elif input_month == 'June':

   if not(1<=input_day<=30):

       print("Invalid")

   elif input_day<=20:

       print ("Spring")

   else:

       print("Summer")

elif input_month == 'July' or 'August':

   if not(1<=input_day<=31):

       print("Invalid")

   else:

       print("Summer")

elif input_month == 'September':

   if not(1<=input_day<=30):

       print("Invalid")

  elif input_day<=21:

       print ("Summer")

   else:

       print ("Autumn")

elif input_month == "October":

   if not(1<=input_day<=31):

      print("Invalid")

   else:

       print("Autumn")

elif input_month == "November":

   if not(1<=input_day<=30):

       print("Invalid")

   else:

       print ("Autumn")

elif input_month == "December":

   if not(1<=input_day<=31):

       print("Invalid")

   elif input_day <=20:

       print ("Autumn")

   else:

       print ("Winter")

elif input_month == 'January':

   if not(1<=input_day<=31):

       print("Invalid")

   else:

       print("Winter")

elif input_month == "February":

   if not(1<=input_day<=29):

       print("Invalid")

   else:

       print ("Winter")

Read more about programming here:

brainly.com/question/23275071

#SPJ1

You might be interested in
A content-managed site can be customized _____.
natita [175]

Good question. The best answer is that it all depends on your project's specifications. Here are a few scenarios where a custom CMS would make sense:

You have security concerns or corporate security requirements that would make off-the-shelf platforms unacceptable. An example of this could be stringent security requirements that limit the amount of software licenses allowed, or that require tightening so severe that it would inhibit the ability of the platform to operate correctly. Also, remember that off-the-shelf platforms are more susceptible to random attacks by bots and other automated attackers.

You require advanced features. If you plan on having a website requiring advanced customization, evaluate if you are pushing the limits of off-the-shelf CMS platforms. An example would be software that is core to your business that must be custom built on top of the CMS platform. Future risks could be the inability to run a proper software update, or even worse, a software update breaking your custom code. It happens all the time!

3 0
3 years ago
Elisa and Josh need to access General Help. Elisa will press the F1 key. Josh will click on ? in the upper-right corner of the W
astraxan [27]
It will be elisa who will get to it
3 0
3 years ago
Read 2 more answers
Given the following function definition
siniylev [52]

Answer:

B. 1 6 3

Explanation:

Given function definition for calc:

void calc (int a, int& b)

{

int c;

c = a + 2;

a = a * 3;

b = c + a;

}

Function invocation:

x = 1;

y = 2;

z = 3;

calc(x, y);

cout << x << " " << y << " " << z << endl;

  • Since x is passed by value, its value remains 1.
  • y is passed by reference to the function calc(x,y);

Tracing the function execution:

c=3

a=3

b=c+a = 6;

But b actually corresponds to y. So y=6 after function call.

  • Since z is not involved in function call, its value remain 3.

So output: 1 6 3

3 0
3 years ago
To find resources on the Internet for your courses, you may need to use a search engine. Suppose that you are collecting informa
tekilochka [14]

Answer:

d. "Columbus, Wisconsin"

Explanation:

mark me brainliest please

8 0
3 years ago
Which keys can be pressed to change the cuboid/frame selector color on remotasks lidar course
Dmitry_Shevchenko [17]

Answer:

c h b l

color palette and a lightbulb

5 0
3 years ago
Other questions:
  • Developers work together with customers and useras to define requirements and specify what the proposed system will do. If once
    9·1 answer
  • Microsoft access does not create n:m relationships because microsoft access creates databases based on
    7·1 answer
  • Is it possible to uninstall a program that's on your phone from computer?
    8·1 answer
  • Which of the following is NOT essential for individuals to have to build their own web page?
    9·1 answer
  • .<br> 1. Press the _______ key to move to the next cell in a row.
    14·2 answers
  • Suppose one hundred stores participated in the
    14·1 answer
  • What is the hexadecimal equivalent of the decimal number 256?
    11·1 answer
  • Write a C program that right shifts an integer variable 4 bits. The program should print the integer in bits before and after th
    15·1 answer
  • How does an extranet work?
    15·1 answer
  • Ten ways ict has helped in social development
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!