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 invalid, 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

Answers

Answer 1
Answer:

Answer:

#include <iostream>

#include <string>

using namespace std;

int main() {

   string inputMonth;

   int inputDay;

   cin >> inputMonth >> inputDay;

   if (inputMonth == "January" && inputDay >= 1 && inputDay <= 31)

       cout << "Winter" << endl;

   else if (inputMonth == "February" && inputDay >= 1 && inputDay <= 29)

       cout << "Winter" << endl;

   else if (inputMonth == "April" && inputDay >= 1 && inputDay <= 30)

       cout << "Spring" << endl;

   else if (inputMonth == "May" && inputDay >= 1 && inputDay <= 30)

       cout << "Spring" << endl;

   else if (inputMonth == "July" && inputDay >= 1 && inputDay <= 31)

       cout << "Summer" << endl;

   else if (inputMonth == "August" && inputDay >= 1 && inputDay <= 31)

       cout << "Summer" << endl;

   else if (inputMonth == "October" && inputDay >= 1 && inputDay <= 31)

       cout << "Autumn" << endl;

   else if (inputMonth == "November" && inputDay >= 1 && inputDay <= 30)

       cout << "Autumn" << endl;

   else if (inputMonth == "March" && inputDay >= 20 && inputDay <= 31)

       cout << "Spring" << endl;

   else if (inputMonth == "June" && inputDay >= 1 && inputDay <= 20)

       cout << "Spring" << endl;

   else if (inputMonth == "June" && inputDay >= 21 && inputDay <= 30)

       cout << "Summer" << endl;

   else if (inputMonth == "September" && inputDay >= 1 && inputDay <= 21)

       cout << "Summer" << endl;

   else if (inputMonth == "September" && inputDay >= 22 && inputDay <= 30)

       cout << "Autumn" << endl;

   else if (inputMonth == "December" && inputDay >= 0 && inputDay <= 20)

       cout << "Autumn" << endl;

   else if (inputMonth == "December" && inputDay >= 21 && inputDay <= 30)

       cout << "Winter" << endl;

   else if (inputMonth == "March" && inputDay >= 1 && inputDay <= 19)

       cout << "Winter" << endl;

   else

       cout << "Invalid" << endl;

   return 0;

}

Answer 2
Answer:

Answer:

FOR PYTHON!!

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':

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

       print("Invalid")

   else:  

       print("Summer")

       

elif input_month == 'August':

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

       print("Invalid")

   else:  

       print("Summer")

elif input_month == 'September':

   if not(1<=input_day<31):

       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")

Explanation:

Good luck in the rest of your class!


Related Questions

Blender questions6. In the default 3-D view, which of the following changes depending on what actions are being carried out on the screen, and acts as the roadmap? (1 point)the pivot pointthe toolbar areathe view editorthe info header7. You cannot use the manipulator widget to translate, define, rotate, or scale an object. (1 point)truefalse
In C++, write a program that asks the user to input an integer and then calls a function namedmultiplicationTable(), which displays the results of multiplying the integer by eachof the numbers 2 through 10.
What component can be used for user input or display of output?JButtonJLabelJTextFieldJFrame
You text file begins with the following rows. The pattern is a description of the item to be repaired, its color, and the issue. bike, red, flat tire bike, blue, broken chain skate, blue, loose wheel mitt, red, torn lace Your program starts with the following lines. import csv aFile = open("data\broken.txt","r") aReader = csv.reader(aFile) countRed = 0 for item in aReader: When you write code to count the number of times red is the color, what is the index of "red"?
What are some of the common security weaknesses inherent in Unix or Linux based systems and what techniques can be used to harden these systems against an attack?

A database is composed of several parts known as database ____

Answers

fragments.....is the answer...
Hope it Helpz..!!

Perform depth-first search on each of the following graphs; whenever there's a choice of vertices, pick the one that is alphabetically first. Classify each edge as a tree edge, forward edge, back edge, or cross edge, and give the pre and post number of each vertex.

Answers

Answer:

See the table attached for complete solution to the problem.

An example of negative self-talk is:

Answers

Answer:

when you call yourself fat or ugly......but that was my answer but pls dont ever be negative abt yalls selfs i love yall the way u are and if u eva wanna talk ill do it in the comments

Explanation:

Answer:

for example, when there is a bad driver on the road near you does something dumb and the little voice in your head always says you idiot watch where you are going. It also can be when you put yourself down like saying that you are dumb or that you will never get a job

Conduct research to determine the best network design to ensure security of internal access while retaining public website availability.

Answers

The best method in network security to prevent intrusion are:

  • Understand and use OSI Model.  
  • Know the types of Network Devices.  
  • Know Network Defenses.  
  • Separate your Network.

How can I improve security through network design?

In the above case, the things to do is that one needs to focus on these areas for a a good network design. They are:

  • Physical security.
  • Use of good firewalls.
  • Use the DMZ, etc.

Therefore, The best method in network security to prevent intrusion are:

  • Understand and use OSI Model.  
  • Know the types of Network Devices.  
  • Know Network Defenses.  
  • Separate your Network.

Learn more about network security from

brainly.com/question/17090284

#SPJ6

Answer:

There are many benefits to be gained from network segmentation, of which security is one of the most important. Having a totally flat and open network is a major risk. Network segmentation improves security by limiting access to resources to specific groups of individuals within the organization and makes unauthorized access more difficult. In the event of a system compromise, an attacker or unauthorized individual would only have access to resources on the same subnet. If access to certain databases in the data center must be given to a third party, by segmenting the network you can easily limit the resources that can be accessed, it also provides greater security against internal threats.

Explanation:

What subnet mask or CIDR notation would be required to maximize the host counts while still meeting the following requirements: 192.168.228.0 255.255.255.128 Required Networks: 2 Required Hosts: 20

Answers

Answer:

192.168.228.0 255.255.255.224

Explanation:

192.168.228.0 255.255.255.128

subnet mask: defines the host and the network part of a ip

CIDR notation : is the shortened form for subnet mask that uses the number of host bits for defining the host and the network part of a ip

For example: 192.168.228.0 255.255.255.128 has CIDR equivalent of 192.168.228.0\25

To have atleast 20 hosts

20 ≤ (2^x) -2

x ≈5

with 5 host bits, we have 2^5-2 = 30 hosts per subnet

and 2^3 = 8 subnets

To get the subnet mask, we have 3 network bits

1110000 to base 10 = 2^7 + 2^6 +2^5= 224

192.168.228.0 255.255.255.224

Jenae helps maintain her school web site and needs to create a web site poll for students. Which tool will she use?

Answers

She needs to use a web browser

Answer:

web browser

Explanation:

the other three will not let her excess her page at all