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
The best way to ensure the accuracy and safety of your accounts is to:
Gekata [30.6K]
Use symbols and a different password for each one

6 0
2 years ago
Briefly explain the following terms and concepts:
morpeh [17]

Answer:

Answer below

Explanation:

Maximum transmission unit (MTU)

A maximum transmission unit (MTU) is the largest packet or frame size that is usually specified in Eight-bit bytes, which can be sent in a packet or frame-based network such as the internet.  

Longest Prefix Match

Longest prefix match is an algorithm used by routers in Internet Protocol to lookup the IP prefix that will likely be the terminal point of the next hop from the router.

CIDR and Subnet Mask

CIDR, known in full as Classless inter-domain routing, is a set of IP standards that is used to make customized identifiers for networks and individual devices.  

A subnet mask separates the internet protocol (IP) address into the network address and host address.

 

Switching Fabric

Switching fabric is simply an arrangement of the elements of a communication network also known as network topology, whereby the nodes of the network are seen to interconnect with one or more network switches.

7 0
2 years ago
Read 2 more answers
Which of the following is the correct order for arranging these titles in a subject filing system? A. Applications, Banking Serv
Ket [755]

Answer:

The correct answer is option (A) Applications, Banking Services, Customer Service

Explanation:

Solution

Methods of filing

There are 5 methods of filing:

• Filing by Subject/Category

• Filing in Alphabetical order

• Filing by Numbers/Numerical order

• Filing by Places/Geographical order

• Filing by Dates/Chronological order

In this case, we can fill by Alphabetical order which is given below

Applications, Banking Services, Customer Service

7 0
3 years ago
If a line is 4’ and you scaled it using 1/8” =1’ what would the size of the line be?
Gnesinka [82]
One half inch to scale
8 0
3 years ago
In addition to compiling the list of user access requirements, applications, and systems, the BIA also includes processes that a
laila [671]

Answer:

automated

Explanation:

Basically a Business Impact Analysis (BIA) estimates and determines the effects of a business activity and process disturbances. These disruptions can be natural or electronic disasters. It also collects information which is used to establish recovery plan. It identifies the business vulnerabilities and works on the strategies in order to reduce such potential hazards. The BIA involves both manual and automated processes. BIA involves automated processes which include the automated software tools that enables the protection of the confidential information of the users and also generates automated reports about the critical business processes.

5 0
3 years ago
Other questions:
  • considering that two variables counters and accumulators are important in loop design. What would be their purpose?
    9·1 answer
  • Select the proper ergonomic keyboarding techniques.
    15·2 answers
  • Write the following function without using the C++ string class or any functions in the standard library, including strlen(). Yo
    12·1 answer
  • .When an argument is passed ______________, the called method can access and modify the caller’s original data directly.
    8·1 answer
  • zeroIt is a function that takes one argument and returns no value. The function stores the value 0 back into the parameter. x is
    8·1 answer
  • A large IPv4 datagram is fragmented into 4 fragments at router 1 to pass over a network with an MTU of 1500 bytes. Assume each f
    15·1 answer
  • What is the maximum current that should be allowed in a 5.0w 220 resistor?
    12·1 answer
  • In which situations would it be most helpful to filter a form? Check all that apply.
    8·1 answer
  • Plz help fast! will mark brainliest!<br><br>List three ways that music is used in modern society.
    6·1 answer
  • Who play fortnite gameeeeeeee
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!