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
11111nata11111 [884]
3 years ago
14

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 a

nd 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
Computers and Technology
1 answer:
Ierofanga [76]3 years ago
3 0

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;

}

You might be interested in
The smallest unit of time in music called?
zmey [24]

Answer:

Ready to help ☺️

Explanation:

A <em>tatum</em> is a feature of music that has been defined as<u> the smallest time interval</u> between notes in a rhythmic phrase.

7 0
3 years ago
Read 2 more answers
Which of the following statements about websites is NOT true?
Inga [223]
The correct answer choice would be letter B.

I hope that this helps !
6 0
3 years ago
Read 2 more answers
Se tiene un pilar de hormigón de 30 cm de lado y 5 m de altura. Presenta una densidad de 2400 kg/m3 y una resistencia a la compr
kakasveta [241]

Answer:

El pilar no podrá soportar una masa de 10 toneladas

Explanation:

La dimensión del pilar de hormigón se da de la siguiente manera;

La longitud del lado, s = 30 cm = 0,3 m

La altura del pilar, h = 5 m

La densidad del pilar, ρ = 2,400 kg / m³

La resistencia a la compresión del pilar, σ = 500 kg / m²

El área de la sección transversal del pilar, A = s² = 0.3 m × 0.3 m = 0.09 m²

La masa del pilar, m = ρ × A × h = 2,400 × 0.09 × 5 = 1,080

La masa del pilar, m = 1.080 kg

Tenemos;

\sigma = \dfrac{F}{A}

Dónde;

F = La carga aplicada

A = El área de la sección transversal

∴ F = A × σ

F = 0,09 m² × 500 kg / m² = 45 kg

Por tanto, la carga que el pilar puede soportar sin compresión = 45 kg <10 toneladas = 9.071,847 kg

El pilar no podrá soportar una masa de 10 toneladas.

6 0
3 years ago
github Portfolio Balances An investor opens a new account and wants to invest in a number of assets. Each asset begins with a ba
OLEGan [10]

The following code will be used to determine the maximum amount invested

<u>Explanation:</u>

long maxValue(int n, int rounds_rows, int rounds_columns, int into rounds)

{

   // Define the variable to store

   // the maximum amount invested.

   long max = 0;

   

   // Define an array of size n,

   // to store the n investments.

   long *investments = (long*)malloc(sizeof(long)*n);

   int i=0;  

   // Initially set all

   // the investments to 0.

   for(i=0;i<n;i++)

   {

       investments[i] = 0;

   }

   i=0;

   // Run the loop to

   // perform the rounds.

   while(i<rounds_rows)

   {

       // Get the left value

       // of the current round.

       int left = rounds[i][0];

       

       // Get the right value

       // of the current round.

       int right = rounds[i][1];

       // Get the contribution

       // for the current round.

       int contribution = rounds[i][2];

       // Since the user uses 1-based

       // indexing, subtract 1 from left

       // and right as the program uses

       // 0-based indexing. That is, the

       // investments in the array start

       // from 0 and not 1.

       right = right - 1;

       int j=0;

       // Run the loop to add the

       // contribution to all the investments

       // between left and right, both inclusive.

       for(j=left; j<=right; j++)

       {

           investments[j] += contribution;

       }

       i++;

   }

   // Traverse the investments array

   // to find the maximum element.

   max = investments[0];

   for(i=1; i<n;i++)

   {

       if(investments[i]>max)

       {

           max = investments[i];

       }

   }

   // Return the

   // maximum investment.

   return max;  

}

6 0
3 years ago
you are the it manager for your company. you have been asked to give the executive group the right to read, change, and assign p
inn [45]

The permission to give the executive group the right to read, change, and assign permissions to document is Give executive Change to shared permissions

<h3>What do you mean of executive?</h3>

An executive is seen as a kind of a powerful person  and they are the people that are known to be  responsible for making things go on or  run smoothly in any organization.

Therefore, The permission to give the executive group the right to read, change, and assign permissions to document is Give executive Change to shared permissions

Learn more about executive  from

brainly.com/question/838027

#SPJ1

5 0
2 years ago
Other questions:
  • Get user input as a boolean and store it in the variable tallEnough. Also, get user input as a boolean and store it in the varia
    8·1 answer
  • What command launches the remote desktop client for windows?
    12·1 answer
  • Two samples of dirt are collected from a suspect's tread in his shoe and a crime scene. The forensic investigator does a gross e
    6·2 answers
  • PLS HELP ;CC
    12·1 answer
  • What is the biggest danger when you reveal information such as your Social Security number?
    15·2 answers
  • someone please please help with this we have to make a sketch of a hydraulic spreader or cutter I chose the spreader now we have
    14·1 answer
  • What is the TSA motto
    7·1 answer
  • What report provides data on how specific sections of a website performed?
    6·1 answer
  • How do you give people a brianly i am knew as u can tell
    6·2 answers
  • ...............................
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!