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
Nostrana [21]
3 years ago
8

Write a program that inputs an integer denoting a month (1 for January, 2 for February, ... , 12 for December), and outputs how

many days are in that month. Assume no leap years. For example, if the input is 2, the output is 28. If the input is 11, the output is 30.[ There are a variety of ways to do this...One approach is to use 12 separate if-then statements. Another approach uses just 3 if-then statements and the logical OR operator (which is ||). ]
Computers and Technology
1 answer:
Korolek [52]3 years ago
6 0

Answer:

// program in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variable

int inp_month;

cout<<"Enter month:";

// read month

cin>>inp_month;

// if month is february

if(inp_month==2)

cout<<"Number of days in month:28"<<endl;

// if month is 4 or 6 or 9 or 11

else if(inp_month==4||inp_month==6||inp_month==9||inp_month==11)

cout<<"Number of days in month:30"<<endl;

else

// for others month

cout<<"Number of days in month:31"<<endl;

return 0;

}

Explanation:

Read month from user and assign it to variable "inp_month".If month is 2 then  there is 28 days in the month.If input month is 4 or 6 or 9 or 11 then there is 30 days in the month.For other month there will be 31 days in month.We assume there is no leap year.

Output:

Enter month:4                                                                                                              

Number of days in month:30

You might be interested in
Two methods defined within a class are shown below. What can be said about the variable x used in both methods?
ANTONII [103]
Hi! Well, the variable 'x' is preceded by 'this.'. I can't say for sure what language this is, but it's probably Java or a C language, right? Then the 'this' refers to the instance of the class.

So 'x' is an instance variable. That means it's a variable that belongs to an instantiated object.
7 0
3 years ago
Why would a business consider using virtual machines?
Nuetrik [128]
The answer is A, or To be able to maintain servers remotely. Why? Well, a business would not want to allow outside customers access to files because that’s a blatant red flag. There would be no reason to completely eliminate physical servers because there simply isn’t a reason to. They would not want to secure the company intranet because if they did, their solution would not be to use virtual machines surely.

Your final answer: To be able to maintain servers remotely. It’s slightly more efficient, and it makes sense for the company to be accomplishing this goal by using virtual machines.
7 0
2 years ago
A user calls you and says that when they try to connect to the internal website, they are prompted for authentication. The user
Kazeer [188]

Answer:

The Local site's URL should be added to the Local internet zone.

Explanation:

3 0
3 years ago
Answer will be marked brainliest
zhuklara [117]

Answer:

Normal laptop screen repair services cost AED 350 to AED 950 i think...

5 0
3 years ago
I was wondering how to give a person a Brainliest answer. Could someone please explain to me the steps on to giving someone a Br
alina1380 [7]
When more than 1 person gives an answer to your question, you receive the option to tick the one you think is more well-explained or thought out in order to make that the Brainliest Answer :)
4 0
3 years ago
Other questions:
  • When looking at an object or process to code, it is important to think of as general a solution as possible and consider all the
    13·1 answer
  • Assume the existence of a Building class with a constructor that accepts two parameters:_________ a reference to an Address obje
    5·1 answer
  • What is intergrated circuit ic​
    10·1 answer
  • Activities that scan network locales for active systems and then identify the network services offered by the host systems is kn
    12·1 answer
  • OSHA has authority over the employers of
    5·2 answers
  • The ____ of an identifier refers to where in the program an identifier is accessible (visible).
    10·1 answer
  • MARKETING HELP PLEASE?!?!?
    15·1 answer
  • Modify the NumberedList class we implementd during the lecture by adding a member function: void NumberedList::insertPosition(in
    13·1 answer
  • ______ is a type of specialized expansion bus used to connect audio and video equipment to the computer.
    10·1 answer
  • Most jobs in computer disciplines require which minimum level of education?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!