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
alexira [117]
3 years ago
9

In python

Computers and Technology
1 answer:
AnnZ [28]3 years ago
7 0

Answer:

The program in Python is as follows:

mnths = ["january","february","march","april","may","june","july","august","september","october","november","december"]

days = int(input("Day: "))

month = input("Month: ")

if not(month.lower() in mnths):

   print("Invalid")

else:

   month_index = mnths.index(month.lower())

   if month_index == 0:

       if days<1 or days>31:            print("Invalid")

       else:            print("Winter")

   elif month_index == 1:

       if days<1 or days>28:            print("Invalid")

       else:            print("Winter")

   elif month_index == 2:

       if days<1 or days>31:            print("Invalid")

       elif days<= 19:            print("Winter")

       else:            print("Spring")

   elif month_index == 3:

       if days<1 or days>30:            print("Invalid")

       else:            print("Spring")

   elif month_index == 4:

       if days<1 or days>31:            print("Invalid")

       else:            print("Spring")

   elif month_index == 5:

       if days<1 or days>30:            print("Invalid")

       elif days<= 20:            print("Spring")

       else:            print("Summer")

   elif month_index == 6:

       if days<1 or days>31:            print("Invalid")

       else:            print("Summer")

   elif month_index == 7:

       if days<1 or days>31:            print("Invalid")

       else:            print("Summer")

   elif month_index == 8:

       if days<1 or days>31:            print("Invalid")

       elif days<= 21:            print("Summer")

       else:            print("Autumn")

   elif month_index == 9:

       if days<1 or days>31:            print("Invalid")

       else:            print("Autumn")

   elif month_index == 10:

       if days<1 or days>30:            print("Invalid")

       else:            print("Autumn")

   elif month_index == 11:

       if days<1 or days>31:            print("Invalid")

       elif days<21:            print("Autumn")

       else:            print("Winter")

Explanation:

<em>See attachment for complete source file, where comments are used to explain difficult lines</em>

Download txt
You might be interested in
Erik is the president and owner of Watch Out, a local website development company that helps clients create and build unique web
11111nata11111 [884]

Answer:

A. Source code

Explanation:

In the field of Programming; Source code is the code written in high level language given to the computer to translate to machine -  executable code before executing. It is usually written and understood by human. It is closer to human like language, as it allows easier expression. It is mostly consist of english-like statement.

So, Erik would primarily be writing source code when performing his daily tasks since his daily task require high level of computer programming and internet knowledge.

5 0
3 years ago
Answer 1 question and get 10 points in return
AlekseyPX

Answer:

3

Explanation:

sorry if I'm wrong...it's been a while since I took a coding class.

5 0
3 years ago
Read 2 more answers
LAB: Count characters - methods
tangare [24]

Answer:

i hope understand you

mark me brainlist

Explanation:

using namespace std;

#include <iostream>

 

#include <string.h>

#include <stdlib.h>

#include <stdio.h>

 

#define BLANK_CHAR (' ')

 

 

int CountCharacters(char userChar, char * userString)

{

 

int countReturn=0;

 

int n = strlen(userString);

 

for (int iLoop=0; iLoop<n; iLoop++)

{

       if (userString[iLoop]==userChar)

       {

        countReturn++;

 }

}

return(countReturn);

}

 

/******************************************

    Removes white spaces from passed string; returns pointer

     to the string that is stripped of the whitespace chars;

   

  Returns NULL pointer is empty string is passed;  

     Side Effects:

 CALLER MUST FREE THE OUTPUT BUFFER that is returned

 

 **********************************************************/

char * RemoveSpaces(char * userString)

{

 

 char * outbuff = NULL;

 

 if (userString!=NULL)

 {

   int n = strlen(userString);

    outbuff = (char *) malloc(n);

 

   if (outbuff != NULL)

   {

          memset(outbuff,0,n);

          int iIndex=0;

          //copies non-blank chars to outbuff

         for (int iLoop=0; iLoop<n; iLoop++)

         {

           if (userString[iLoop]!=BLANK_CHAR)

          {

           outbuff[iIndex]=userString[iLoop];

           iIndex++;

   }

   

   } //for

         

   }

   

   }

 return(outbuff);

 

}

 

 

int main()

{

 

 char inbuff[255];

 cout << " PLEASE INPUT THE STRING OF WHICH YOU WOULD LIKE TO STRIP WHITESPACE CHARS :>";

 gets(inbuff);

 

 char * outbuff = RemoveSpaces(inbuff);

 if (outbuff !=NULL)

 {

    cout << ">" << outbuff << "<" << endl;

    free(outbuff);

    }

     

   memset(inbuff,0,255);  

   cout << " PLEASE INPUT THE STRING IN WHICH YOU WOULD LIKE TO SEARCH CHAR :>";

gets(inbuff);

 

  char chChar;

 cout << "PLEASE INPUT THE CHARCTER YOU SEEK :>";

 cin >> chChar;

 

 int iCount = CountCharacters(chChar,inbuff);

 cout << " char " << chChar << " appears " << iCount << " time(s) in >" << inbuff << "<" << endl;

 

}

4 0
3 years ago
How can you check an orthographic drawing to be sure there are no missing lines
user100 [1]
With an magnify glass
4 0
3 years ago
Which type of user profile is stored in the C:\Users folder and is automatically created when a user logs on to the computer for
Sladkaya [172]

Answer:

a. Local user profile.

Explanation:

Local user profile is a type of user profile which is stored in the C:\Users folder and is automatically created when a user logs on to the computer for the first time and it is being stored on the local hard disk of the computer.

Generally, in Microsoft windows any change made to the local user profile is peculiar to the user and the host computer on which the change is made.

Hence, local user profiles avails several users the opportunity of sharing a single computer with their respective user settings and data.

3 0
3 years ago
Other questions:
  • When looking at an object or process to code, it is important to think of as general a solution as possible and consider all the
    13·1 answer
  • An independent frame that holds a program, document, or folder contents in windows 7 is called a ____.
    11·1 answer
  • How it print media used? ​
    9·1 answer
  • You should use a ____ chart to compare values side by side, broken down by category.
    9·1 answer
  • مسألة لبرنامج الماتلاب لمصفوفة وعمود
    10·1 answer
  • To display the entire entry for a calculated field, select the column in the Field row, right-click to display the shortcut menu
    15·1 answer
  • Hey guys!
    5·2 answers
  • What network problems can be solved on your<br> end?
    13·2 answers
  • What information is contained in the title bar
    13·1 answer
  • Can anyone fix this code for me?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!