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
How are modern computers different from eniac?
Natalka [10]
Modern computers use in side a memory board to store info but back then you would use flappy disks   
8 0
3 years ago
If a fire should break out in your building, which of the following actions is NOT recommended?
quester [9]

C) Scream and run

you need to remain calm and carefully exit the building making sure you have everybody with you

6 0
3 years ago
Read 2 more answers
When you use the tilde operator (~ in a url for the attribute of a server control, it represents the _____ directory of the webs
Verizon [17]
The tilde operator represents the root directory of the website.
4 0
3 years ago
What’s the answer for this
attashe74 [19]
I believe the answer is B<span />
3 0
3 years ago
"in troubleshooting a boot problem, what is the advantage of restoring all uefi/bios settings to their default values?"
Alex17521 [72]
When this case would appear, one thing that I would do personally would first, go to the settings, in then, after having this done, I would then "scroll down" to where ti would say "restore (uefi/bios) files, and from there, you would get every value that would would have from the beginning in your chip.

And also, what is truly unique would be the fact that you would be able to choose the "restore point" that you would like for it to appear.
3 0
2 years ago
Other questions:
  • Question 4 (2 points)
    6·2 answers
  • The equipment that processes data in order to create information is called the _______.
    8·2 answers
  • What data discovery process, whereby objects are categorized into predetermined groups, is used in text mining?
    9·1 answer
  • What are examples of templates the Input Mask Wizard offers? Check all that apply.
    12·2 answers
  • You are reviewing the output of the show interfaces command for the Gi0/1 interface on a switch. You notice a significant number
    12·1 answer
  • One problem with _______ is that often many copies of the same document are made. <br><br>HELPPP ​
    11·1 answer
  • What is a computer please tell me ​
    10·2 answers
  • What is software?
    6·1 answer
  • 1) What is Database? List its Uses.<br>​
    15·1 answer
  • Because his father _____ his ten-speed bike away to punish him for his failing grades, the boy sulked for two days.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!