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
Which storage device would you most likely use to share a file with a classmate?
valina [46]
You’d probably use a USB Flash Drive.
6 0
4 years ago
Read 2 more answers
Read the scenarios below, then use the drop-down menus to decide if you should use a database.
Romashka [77]

Answer:

A. The parent-teacher orginization keeps a log of cookies sales to raise money for the elementary school.

Explanation:

5 0
3 years ago
Why is body language an important indicator in business meetings? A. You will be able to communicate more strongly. B. You will
pantera1 [17]

Answer:

you will know if your audience is engaged.

Explanation:

6 0
3 years ago
Jasmine is a commercial artist her is is the one most often used by graphic designers publishers and others in her field the os
VikaD [51]
OS is for mac so she used the mac computer
7 0
3 years ago
When you add audio or video to a PowerPoint presentation, you can specify that it plays on a click or __________ when the slide
Anastasy [175]

Answer:

automatically

Explanation:

You can tell power-point to start a video added to it upon clicking it or another way to do it is to specify that it should play automatically as soon as the slide appears in the course of the slide show or presentation. One can go about it in different ways; using the audio/video tools playback tab to start the video immediately the slides appear or; starting the video or audio after a delayed period using the animation options.

3 0
4 years ago
Other questions:
  • What is the term for a male reproductive cell?​
    14·1 answer
  • What type of html list will automatically place a number in front of the items?
    9·1 answer
  • What is the name of the technology that is typically implemented on switches to avoid Ethernet connectivity problems when the wr
    11·1 answer
  • can you give me a tip to fix my SIM card becuaus when i put it on my phone it has no signal , can anyone fix this , thank you.​
    9·2 answers
  • Describe at least two other companies that are direct or indirect competitors to your company. Explain how you will differentiat
    15·1 answer
  • Anyone down to play gta later i play on ps4?
    15·2 answers
  • Consider an array inarr containing atleast two non-zero unique positive integers. Identify and print, outnum, the number of uniq
    10·1 answer
  • Explain any two features of a computer​
    15·1 answer
  • Select the correct answer.<br><br> Which statement is true with respect to Java?
    6·1 answer
  • Gaining information by tricking an individual into releasing information is often referred to as.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!