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
maxonik [38]
3 years ago
15

3.19 LAB: Seasons In C++ Write a program that takes a date as input and outputs the date's season. The input is a string to repr

esent the month and 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: Blue 65 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:
vlabodo [156]3 years ago
5 0

Answer:

#include <iostream>

#include <string>

using namespace std;

int main() {

  string mth;

int dy;

cin >> mth >> dy;

if ((mth == "January" && dy >= 1 && dy <= 31) || (mth == "February" && dy >= 1 && dy <= 29) || (mth == "March" && dy >= 1 && dy <= 19) || (mth == "December" && dy >= 21 && dy <= 30))

cout << "Winter" << endl;

else if ((mth == "April" && dy >= 1 && dy <= 30) || (mth == "May" && dy >= 1 && dy <= 30) || (mth == "March" && dy >= 20 && dy <= 31) || (mth == "June" && dy >= 1 && dy <= 20))

cout << "Spring" << endl;

else if ((mth == "July" && dy >= 1 && dy <= 31) || (mth == "August" && dy >= 1 && dy <= 31) || (mth == "June" && dy >= 21 && dy <= 30) || (mth == "September" && dy >= 1 && dy <= 21))

cout << "Summer" << endl;

else if ((mth == "October" && dy >= 1 && dy <= 31) || (mth == "November" && dy >= 1 && dy <= 30) || (mth == "September" && dy >= 22 && dy <= 30) || (mth == "December" && dy >= 0 && dy <= 20))

cout << "Autumn" << endl;

else

cout << "Invalid" << endl;

  return 0;

}

Explanation:

You might be interested in
Which software is used to play, create, and modify audio and video files?
igor_vitrenko [27]
Video Editing software is used to play, create, and modify audio and video files. 
7 0
3 years ago
Read 2 more answers
Selecting the Tiled windows arrangement option places the windows in a(n) _______ pattern on the screen.
Archy [21]

Answer:

Selecting the Tiled windows arrangement option places the windows in a(n) Grid pattern on the screen.

Explanation:

3 0
2 years ago
Digital Subscriber Line (DSL) is the only Internet connection option available for a small office in the middle of nowhere. Whic
andrey2020 [161]

What's up!!! :D A Tech-Savvy here:

Answer:

Symmetric Digital Subscriber Line (SDSL)

Cheers,

Feel free to ask me anything regarding ICT/Tech.

7 0
3 years ago
What is RAM and ROM​
Aleonysh [2.5K]

Answer:

Read-only memory, or ROM, is a form of data storage in computers and other electronic devices that can not be easily altered or reprogrammed. RAM is referred to as volatile memory and is lost when the power is turned off whereas ROM in non-volatile and the contents are retained even after the power is switched off.

8 0
3 years ago
Read 2 more answers
What are the reasons why organizations opt for a certificate
Nata [24]

Answer:

Because it helps you prove that you're you to third parties who wouldn't know otherwise. A CA helps you to establish trust with others because they're trusted for issuing valid, reliable certificates — and that trust is integral to public key infrastructure (PKI).

Explanation:

with this info I believe it is a A and C

6 0
2 years ago
Other questions:
  • Web storage stores data in the browser in
    5·1 answer
  • Fill the validateForm function to check that the phone number contains a number (use the isNaN function) and that the user name
    10·1 answer
  • Explain in detail what it means to synchronize computers and mobile devices. include at least two strategies for keeping your fi
    7·1 answer
  • When you are driving on a rural road, if your right wheels run off the pavement, you should hold the steering wheel firmly and?
    10·2 answers
  • Which is an example of static web page??
    9·2 answers
  • If you configure any more passwords on the switch, will they be displayed in the configuration file as plain text or in encrypte
    13·1 answer
  • Robert works in a call center and receives a call from Kathy. Kathy says she can no longer access the online reporting applicati
    13·1 answer
  • How does a search engine use algorithms to provide search results?
    15·2 answers
  • An operating system with _____ capabilities allows a user to run more than one program concurrently.
    6·1 answer
  • Which network device sends data to every device that is connected to it?.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!