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
What is the best Describe an integer data type
kolbaska11 [484]

Answer:

It is a data type that only holds whole numbers, a.k.a. integers.

what is the picture about?

3 0
2 years ago
Looking at the example below is the type value equal to a string or an integer?
Simora [160]
B. Integer I think that’s the answer
5 0
2 years ago
Read 2 more answers
Will robots take people's jobs? <br> write in complete sentence.
lilavasa [31]

Answer:

yes

Explanation:

yes because they already have them for old gun ships (which they still use) and they have made cars with them and more including bombing situations IED detinators they used in Afghanistan and in Iraq in 2011.

6 0
3 years ago
What is the primary limitation of free versions of antivirus applications
ddd [48]

Answer:

Please look below for the answer

Explanation:

The primary limitation is that they don’t protect in real time. They also only perform quick scans which is not that efficient. They cannot scan the Windows directory. They only install on 64-bit operating systems

Hope I helped pls mark as brainliest

3 0
3 years ago
In 1–2 sentences, describe how you would change the color of the background of a graph.
never [62]
<span>Click Home > Format Cells dialog launcher (or press Ctrl+Shift+F) <span>On the Fill tab, under Background Color, pick the color you want.</span></span>
3 0
3 years ago
Read 2 more answers
Other questions:
  • katherine has work experience of seven years as a graphic designer and photographer. she wants to now redirect her career to web
    5·2 answers
  • An Operating System is an application just like any other applications we use on our
    7·1 answer
  • Which one is a run-on sentence? you get mark the brilist
    5·2 answers
  • In 3–5 sentences, describe how technology helps business professionals to be more efficient.
    14·2 answers
  • One of your clients has opened a branch office in another state. Both the main office and the new branch office have fast, relia
    10·1 answer
  • What would be a reason for using a workstation rather than a personal computer?
    7·1 answer
  • #5 Multiple Select Which of the following describes a hardware error? Select 3 options.
    7·2 answers
  • A string is represented as an array of characters. If you need to store an array of 5 strings with the maximum length of a strin
    15·1 answer
  • What responds to both visual appeal and functional needs? (1 point) A.) applied art B.) performance art C.) fine art D.) visual
    14·1 answer
  • True/False: Each individual element of an array can be accessed by the array name and an element number, called a subscript. Tru
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!