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
You have spent $4,000 on liquor for your bar. Your bar sales have been $24,000. What is your cost of sales for liquor, expressed
amid [387]

Answer:

17%

Explanation:

Given parameters:

Cost price of liquor = $4000

Total sale = $24000

Unknown:

Percentage cost of sale for liquor = ?

Solution:

To find the percentage cost of sale;

       %Cost of sale of liquor = \frac{cost price of liquor}{Total cost of sale }   x 100

Input the variables;

       %Cost of sale of liquor = \frac{4000}{24000}  x 100 = 16.67% = 17%

8 0
2 years ago
ANSWER ASAP, I'LL MARK THE BRAINLIEST
Travka [436]

Answer:

Push to make switch

Explanation:

The sound is created after you push it. Pushing it is the input and the sound is the output

4 0
2 years ago
In 1-2 sentences, describe how you would open a new word processing document.
Gennadij [26K]
This depends on what computer and
System it's running on
4 0
3 years ago
The Mail Merge Wizard can be found in the drop-down list of the _____ icon.
LuckyWell [14K]
It would have to be letter B.
5 0
3 years ago
Read 2 more answers
Write an algorithm to find the area of a parallelogram​
xeze [42]

Answer:

a = bh

Explanation:

a = Area
b = Base

h = Height

8 0
2 years ago
Other questions:
  • Decisions 1 and 3 are both ____________ decisions because ____________________.
    9·1 answer
  • Which one of these tasks best describes the process of localization?
    12·1 answer
  • Graphic images can be stored in a variety of formats including ____.
    15·1 answer
  • Smoking is a REALLY good example of a choice that can have negative effects on the smoker's health, AND the well-being of others
    9·1 answer
  • A USB zipper drive is a small data storage device that plugs into a computer's USB port.
    14·1 answer
  • ListenListen with ReadSpeakerAn administrator working on a Windows Server 2016 Server Core installation needs to disable DHCP on
    9·1 answer
  • A palindrome is a word or phrase that reads the same both backward and forward. The word ""racecar"" is an example. Create an al
    15·1 answer
  • Pls Help need it before 1pm PLS.
    15·2 answers
  • Explain software piracy and Hacking​
    13·2 answers
  • Responsible use of computer is known as ................. .​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!