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 is true of effective passwords?
mylen [45]

Answer:

It is either A. or D.

4 0
3 years ago
At Tech Edge Inc., a special team is set up for making a robot capable of assisting blind people in daily activities. The member
Ivan

Answer: Cross-functional team

Explanation:

Cross-functional team is the community of people that have expertise quality in different functions to perform and attain a common aim.

  • The fields that are involved in different function are financial department, HR(Human resource) department ,operation team,marketing team etc. in an organization
  • According to the question, new team formed under the senior manager is a cross-functional team.
  • Members of different area such as research and development,manufacturing, marketing etc are gathered togather as a team so that they can work towards the robot project.
6 0
3 years ago
Consider the following pseudocode:
In-s [12.5K]

Answer:

Part a:  The program will print 3.

Part b: The program will print 4

Part c: The program will print 1.

Explanation:

Part a: As the scoping is static, the x integer has a value of 1 and the y integer has a value of 2 so the addition is 2+1=3.

Part b: As the scoping is dynamic with deep binding, the x integer has a value of 2 and the y integer has a value of 2 so the addition is 2+2=4.

Part c: As the scoping is dynamic with shallow binding, the x integer has a value of 1 so it will print 1.

4 0
3 years ago
Complete the function ConvertToDecadesAndYears to convert totalYears to decades and years. Return decades and years using the Ti
Sergeeva-Olga [200]

Answer:

It is a C++ program. The complete function   ConvertToDecadesAndYears which takes totalYears as parameter and convert totalYears to decades and years is provided in the attached document.

Explanation:

The explanation is provided in the attached document.

The screenshot of the complete code along with its output is attached.

6 0
3 years ago
Conceptual note-taking is the act of writing down information in the order it is given. drawing attention to details with a mark
Dvinal [7]

Answer:A

Explanation:Conceptual notetaking is the act of writing down information in the order it is given.

4 0
3 years ago
Read 2 more answers
Other questions:
  • For which task is the WordArt gallery most useful?
    15·2 answers
  • The _____ row is typically the first row in a table.<br><br> banded<br> total<br> header<br> odd
    14·2 answers
  • The replacer parameter of the stringify method accepts a/an ______________ or an array.
    15·1 answer
  • Which wildcard characters will return a single character when using the Find dialog box?
    6·2 answers
  • What is the promotion and advertising stage of a product or service called?
    15·1 answer
  • The process of giving the user the result of processing is called
    14·1 answer
  • Internal memory is synonymous with which memory
    8·2 answers
  • :P 80 points to spare so i guess its free!!!!!!
    9·2 answers
  • Convert one billion byte into one storage unit​
    6·1 answer
  • Alexis received paychecks from both her jobs and she would like to deposit them. One check is for $62.88 and the other is $523.2
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!