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
Allan needs to ensure that an object is in a very precise location on a slide. He decides to use the Ruler option to achieve thi
shusha [124]

Answer:

It can be found on View tab.

Explanation:

The view tab on Microsoft Power point is the 9th tab when counting from the left. When clicked, the view tab displays a number of tools that are aimed at visualizing how slides appear.

The ruler function is one of those tools. It is used to ensure that an object is placed or appears at a specific location in the slides. The ruler tool can be found in the Show Box which is the third box from left after Presentation View and Master View.

8 0
3 years ago
Read 2 more answers
Which types of attacks are thwarted by complex passwords that are combinations of upper and lower case letters, numbers, and spe
lesantik [10]

The types of attacks that are known to be thwarted by complex passwords that are combinations of upper and lower case letters, numbers, and special characters are said to be Brute Force Attacks.

What is Brute Force Attacks?

This is known to be an attack that is said to be a very  crude type of attack and it is often seen as a brute-force attack.

Note that is one that does not depend on lists of passwords, but it is one that often tries all the  very possible combinations of permitted character types.

Hence, this type of attack was known to be historically seen as ineffective, and it is said to be The types of attacks that are known to be thwarted by complex passwords that are combinations of upper and lower case letters, numbers, and special characters are said to be Brute Force Attacks.

Learn more about Brute Force Attacks from

brainly.com/question/17277433

#SPJ1

3 0
1 year ago
Which file extension takes less storage space?
anyanavicka [17]

I believe the answer would be the JPEG file extension.

4 0
2 years ago
Read 2 more answers
4
kupik [55]

Answer:

the answer is D Smart Object

5 0
3 years ago
Read 2 more answers
You want to find information about Paris, France in the last five years, written in English. What is the best way to search for
KonstantinChe [14]
I say It could be B
8 0
3 years ago
Read 2 more answers
Other questions:
  • What are some of the causes for error 1921 when updating?
    11·2 answers
  • Carbon copy others who are..
    14·2 answers
  • Use the modulo operator (%) to get the desired rightmost digits. Ex: The rightmost 2 digits of 572 is gotten by 572 % 100, which
    8·1 answer
  • Which of the following languages does not provide built-in-pattern matching operations (the language, although, has pattern matc
    14·1 answer
  • What makes these Pokémon special?
    9·2 answers
  • Fill in this function that takes three parameters, two Strings and an int. 4- // Write some test function calls here! The String
    9·1 answer
  • Bryan's company is new and has limited funds to work with. He has been tasked with finding a telecommunications technology that
    7·1 answer
  • If any one answered this i will give brilientst what is stimulation program​
    6·1 answer
  • Matt uploads a malware sample to a third-party malware scanning site that uses multiple antimalware and antivirus engines to sca
    11·1 answer
  • I am trying to sum up a set of data based on 2 criteria (needs to have "green" in column E, and "January 2020" in collum A). Col
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!