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
Anna [14]
3 years ago
6

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 in

t to represent the day.
Computers and Technology
1 answer:
frozen [14]3 years ago
8 0

Answer:

void season(char * month, int day){

if(strcpy(month, "January") == 0 || strcpy(month, "February") == 0)

printf("Winter\n");

else if(strcpy(month, "March") == 0){

if(day < 20)

printf("Winter\n");

else

printf("Spring\n");

}

else if(strcpy(month, "April") == 0 || strcpy(month, "May") == 0)

printf("Spring\n");

else if(strcpy(month, "June") == 0){

if(day < 20)

printf("Spring\n");

else

printf("Summer\n");

}

else if(strcpy(month, "July") == 0 || strcpy(month, "August") == 0)

printf("Summer\n");

else if(strcpy(month, "September") == 0){

if(day < 20)

printf("Summer\n");

else

printf("Autumn\n");

}

else if(strcpy(month, "October") == 0 || strcpy(month, "November") == 0)

printf("Autumn\n");

else if(strcpy(month, "December") == 0){

if(day < 20)

printf("Autumn\n");

else

printf("Winter\n");

}

}

Explanation:

I am going to write a C program for this.

I am going to use the function strcpy, from the library string.h, to compare strings. It returns 0 when strings are equal.

I am going to say that the season change happens at day 20, in March, June, September and December

void season(char * month, int day){

if(strcpy(month, "January") == 0 || strcpy(month, "February") == 0)

printf("Winter\n");

else if(strcpy(month, "March") == 0){

if(day < 20)

printf("Winter\n");

else

printf("Spring\n");

}

else if(strcpy(month, "April") == 0 || strcpy(month, "May") == 0)

printf("Spring\n");

else if(strcpy(month, "June") == 0){

if(day < 20)

printf("Spring\n");

else

printf("Summer\n");

}

else if(strcpy(month, "July") == 0 || strcpy(month, "August") == 0)

printf("Summer\n");

else if(strcpy(month, "September") == 0){

if(day < 20)

printf("Summer\n");

else

printf("Autumn\n");

}

else if(strcpy(month, "October") == 0 || strcpy(month, "November") == 0)

printf("Autumn\n");

else if(strcpy(month, "December") == 0){

if(day < 20)

printf("Autumn\n");

else

printf("Winter\n");

}

}

You might be interested in
Does anyone know a NC wise owl password I can use, it's an emergency!! I can't ask my school because they are closed and I need
snow_tiger [21]
The password would be Apple 123
6 0
3 years ago
___________ applications help you manage and present mathematical data easily and perfectly.
elixir [45]

Answer:

Spreadsheet

Explanation:

Spreadsheet applications like Microsoft Excel, Google Sheet, etc. makes the task of managing and presenting the mathematical data quite easy and perfect. It consists of rows and columns, and in each cell, we can apply a set of formulas. Its a great data mining tool as well, where the unprocessed data is cleaned, to form a piece of information at various levels, and fed to top management. It helps in all sorts of analysis, and like statistical analysis. And it supports data visualization as well. which makes the analysis even more fruitful and easy. However, its drawback is, the set of variables cannot be more than 3. And that is where the software like Microsoft Power BI and tableau comes into the picture. And they support spreadsheets as well as various other formats.

5 0
3 years ago
What does the gravity setting of a jump control?
Vikki [24]

Answer:

A

Explanation:

3 0
3 years ago
Hey all! Adobe here. I think that we should talk about After Effects 2021 and After Effects CC 2021. With BRAND NEW FEATURES, (A
ella [17]

Answer:

thx ur the best

7 0
2 years ago
A work order does all of the following EXCEPT:
Lady_Fox [76]

Answer:

c

Explanation:

6 0
2 years ago
Other questions:
  • Here are the codes for producer and consumer problems.
    10·1 answer
  • ¿Cómo es la onda percibida por un osciloscopio cuando hablamos de sonido? ¿Qué parámetros podemos observar en ella?
    15·1 answer
  • A top-notch IT company is seeking an experienced leader to direct a team of experts in the development, creation, and modificati
    14·2 answers
  • If you are unsure about what is or isn’t appropriate to wear to a new job, what is the best thing to do?
    13·2 answers
  • I need help with this plz! It’s for a test and I really need help
    6·1 answer
  • Which character is cannot be used in a file name _ (underscore)/ (backslash)- (hyphen) % ( percent)
    12·1 answer
  • mta software development fundamentals You are creating an application that accepts input and displays a response to the user. Yo
    10·1 answer
  • You designed a program to create a username using the first three letters from the first name and the first four letters of the
    6·1 answer
  • Xxx<br>uuuuuu<br>uuuu<br>jjnmn<br>jjh
    12·1 answer
  • WHAT DOES THE SCRATCH CODE BELOW DO?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!