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
You receive an email from someone who claims to be a representative from your credit card company. The email asks you to click o
Tema [17]
B.) phishing
Definition of phishing:
Try to obtain financial or official information from internet users, usually sent as an email to look like it is from a legitimate company
6 0
3 years ago
Which of the following cools the air in a household refrigerator?
Ivanshal [37]

The following cools the air in a household refrigerator: Absorption of the heat from the air due to evaporation of the liquid refrigerant . Correct answer:B

The function of the refrigerator is to absorb heat into the refrigeration system. The evaporator is placed in the area to be cooled. The refrigerant vaporizes from the heat it absorbs heat in the evaporator.

4 0
2 years ago
Read 2 more answers
When you open your word-processing program, it opens in a<br> field<br> menu
stepan [7]
B- menu...... hope this helps
8 0
3 years ago
Read 2 more answers
What is machine level language ?​
NeX [460]

Answer:

The machine-level language is a language that consists of a set of instructions that are in the binary form 0 or 1.

5 0
2 years ago
What its the difference between Arduinos and Assembler?
Leno4ka [110]

Answer:

The Arduino boards can be programmed in assembly. All you need is an ICSP Cable (In Circuit Serial Programmer) and the AVR toolchain (free from ATMEL) to write to the board. You then get the advantage of on board debugging.

As you suggested, you can just slap an ATMEL chip on a breadboard and go to town.

Explanation: cause i said so

6 0
3 years ago
Other questions:
  • Which of the following can be both an input device and an output device? mouse. keyboard. display screen. laser printer .
    9·1 answer
  • I dopped my Fujifilm Instax mini 8 and now the case won't close and it takes blank pictures can anyone tell me what to do, pleas
    6·2 answers
  • ………………….. is the process of causing a system variable to conform to some desired value. Options Control feedback Design none of
    9·1 answer
  • Could this be restored? And is it worth the money it’d take?
    9·2 answers
  • Because Microsoft Access includes not only the software needed to create a database, but also the software needed to create form
    7·1 answer
  • Create a program that includes a function called toUpperCamelCase that takes a string (consisting of lowercase words and spaces)
    9·1 answer
  • What is TLB for? Why TLB? Given the following number, what is theeffective memory access time?
    11·1 answer
  • Which statement is true of integrating an expert system into the database component of a decision support system (DSS)? a. It re
    14·2 answers
  • What is this?
    15·2 answers
  • Enabling encryption of all data on a desktop or laptop computer is generally considered:______.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!