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
Why is information so important in our lives
GREYUIT [131]
Information is very important because it helps us as a society make decisions. Decisions are impossible without information, and we are constantly seeking information in everything we do. Information is important in decreasing our sense of doubt and uncertainty as well.
5 0
3 years ago
Read 2 more answers
Given integer variables totalTickets, vipTickets, and sessionNum, which line of code correctly calls the following function? voi
alekssr [168]

Given integer variables <em>'totalTickets, vipTickets, and sessionNum'</em>, the line of code given in option C correctly calls the following function: "<em>void FinalTally(int* totalAttendees, int* vipAttendees, int numSessions);</em>"

The correct function call with the variables named <em>'totalTickets, vipTickets, and sessionNum</em>' is as follows:

<em>FinalTally(&totalTickets, &vipTickets, sessionNum); </em>

A function call refers to an expression that passes control and arguments (if there are any) to the specified function and has the syntax as <em>FunctionName (argumentList</em>) where <em>FunctionName is the name of the function to be called and argumentList indicates the list of arguments (separated by commas) to be passed to the calling function</em>.

"

<u><em>Correct question is as follows:</em></u>

Given integer variables totalTickets, vipTickets, and sessionNum, which line of code correctly calls the following function? void FinalTally(int* totalAttendees, int* vipAttendees, int numSessions);

a. FinalTally(totalTickets, vipTickets, &amp;session Num);

b. FinalTally(&amp;totalTickets, &amp;vipTickets, session Num);

c. FinalTally(&totalTickets, &vipTickets, sessionNum);

d. FinalTally(&amp;totalTickets, &amp;vipTickets, &amp;session Num);

"

You can leran more about Function Call at

brainly.com/question/28566783

#SPJ4

3 0
1 year ago
In the circuit seen here, the resistor has a resistance of 3 ohms. If no change in the battery size occurs, what will happen to
Rufina [12.5K]

It will increase by a factor of 2

6 0
3 years ago
Read 2 more answers
How do I cancel a friend request?
dusya [7]

Answer:

By pushing cancel

Explanation:

It's simple

3 0
3 years ago
Read 2 more answers
Which is the best way to determine the bare minimum amount ofhard drive space a system needed?
Zolol [24]

Answer: D)add up the storage requirements for the operating system and all of the software applications currently installed.

Explanation:Hard disk drive (HDD) is the secondary hardware device for the storage of the data permanently. It can be used for storing data along with the videos, documents, pictures etc.

Hard drive can store data  in a large amount as compared to any other drive and having varying capacity of data storage according to the data.The minimum space of the  hard drive to be embedded in a system is calculated on the basis of the storage of files of operating system,software programs and other data.

So, option (D) is the correct option.

5 0
3 years ago
Other questions:
  • Scientific models can be used for a variety of different purposes. Which of the following statements about scientific models is
    7·2 answers
  • Types of relationships include aggregation, composition, link, generalization, and specialization 9. TRUE FALSE
    9·1 answer
  • Beverly is creating a website for her new clothing company. Aside from including photographs, how can she use the index page to
    8·2 answers
  • Which type of microscope can only be used to view non-living specimens?
    10·2 answers
  • A systems administrator is designing a directory architecture to support Linux servers using Lightweight Directory Access Protoc
    11·1 answer
  • Write a program that takes a first name as the input, and outputs a welcome message to that name.
    9·1 answer
  • Create a python code with 5 circles, 5 polygons, 5 line commands, 2 for loops, and 1 global variable
    12·1 answer
  • You are supposed to do a report on something that interests you. You decided to do a report on dogs. As you research, you take n
    14·1 answer
  • Need help ASAP <br><br> Thankss + BRAINLIST only for correct answers
    11·1 answer
  • Cho 1 biến x thuộc kiểu dữ liệu Integer , hãy cho biết biến x dùng để làm gì?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!