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
cestrela7 [59]
2 years ago
7

write a program that asks the user for a month number and displays the number of days that month has?

Computers and Technology
2 answers:
adoni [48]2 years ago
7 0

Answer:

I have used Python language for your question. Code is below in Bold Letters.

Explanation:

Code starts from next line.

print("1 for Jan\n2 for Feb\n3 for Mar\n4 for Apr\n5 for May\n6 for Jun\n7 for Jul\n8 for Aug\n9 for Sep\n10 for Oct\n11 for Nov\n12 for Dec")

a = int(input("Enter the number of a month: \n"))

b = 28

c = 29

d = 30

e = 31

if a == 1:

   print("The month January has", e, "days")

elif a == 2:

   print("The month Febuary has",b, "or", c, "days")

elif a == 3:

   print("The month March has", e, "days")

elif a == 4:

   print("The month April has", d, "days")

elif a == 5:

   print("The month May has", e, "days")

elif a == 6:

   print("The month June has", d, "days")

elif a == 7:

   print("The month July has", e, "days")

elif a == 8:

   print("The month August has", e, "days")

elif a == 9:

   print("The month September has", d, "days")

elif a == 10:

   print("The month October has", e, "days")

elif a == 11:

   print("The month November has", d, "days")

elif a == 12:

   print("The month December has", e, "days")

else:

   print("Enter a valid number")

Code ends here.

Those who found this answer helpful please give me a Thanks and support me. So, I can explain my answers more properly and give you the codes as short as possible. I am not saying to mark me brainliest but to give me Thanks.

uranmaximum [27]2 years ago
4 0

Answer:

Using c++

Explanation:

#include<iostream>

using namespace std;

int main() {

int num;

cout<<"ENTER THE NUMBER OF THE MONTH"<<endl;

cin>>num;

if(num<=1) {

cout<<"The first month is January and it has 31 days";

}

else if(num<=2) {

cout<<"The second month is February and it has 28 days";

}

else if(num<=3) {

cout<<"The third month is March and it has 31 days";

}

return 0;

}

For the remaining months all you need to do is follow these steps.

You might be interested in
FTP is commonly used to __________ and __________ files to a server.
Aleks [24]

Answer:

upload; download

Explanation:

FTP (File Transfer Protocol) is an internet protocol used to upload and download a file to a server, there are some programs help us to transfer this data to a server, in some cases, we're going to need these programs to upload website files to the server like images or videos, or some websites where do you need a user and passwords to upload file by FTP

8 0
3 years ago
We can harden a host by: a. Limiting physical access to it b. Turning off unnecessary services c. Installing patches d. All of t
Rina8888 [55]

Answer:

D

Explanation:

All three of A, B and C are required to harden a host. Thus, All of the above makes the best option.

Hardening simply refers to making your data impossible to be penetrated. More like bulletproof.

To do this, ensure measures like

- Regular Program cleanup

- Patches management

- service pack installation

- service or usage policies

...among others.

Cheers

3 0
2 years ago
Are the blank space around the edges of the page
Law Incorporation [45]

Answer:

The blank space around the edges of a sheet of paper — as with the page of a book — that surrounds the text is called the margin.

8 0
2 years ago
Which activity represents a violation of the licensing agreement?
Lena [83]
A) <span>unauthorized duplication of software </span>
6 0
2 years ago
Read 2 more answers
7. Explain the steps for formatting a shape ?
alisha [4.7K]

Answer:

To begin, select the shapes you want to format. To select more than one, press and hold the Shift key. When you select one or more shapes, a new Drawing Tools tab appears. Here, you can select Shape Fill to fill the selected shapes with a solid color, gradient, texture, or picture.

Explanation:

3 0
2 years ago
Other questions:
  • When Amy turns on her computer, she notices a burning smell. Smoke comes out of the case, and Amy immediately turns off her comp
    7·1 answer
  • Identify the sampling technique used:A lobbyist for a major airspace firm assigns a number to each legislator and then uses a co
    13·1 answer
  • When you're working with a word processing document and you press the Del key, what happens? A. The paragraph you're working on
    12·1 answer
  • The sum of the elements of an integer-valued array recursively calculated as follows: The sum of an array of size 0 is 0; Otherw
    15·1 answer
  • An IT security threat is anything that might cause serious harm to a computer system, including someone stealing a laptop that c
    8·2 answers
  • 13. A 2-sided coin has an equal likelihood of landing on each side. One side is called "heads" and the other is called "tails".
    11·1 answer
  • Consider the following code segment.
    10·1 answer
  • What is the most popular game design engine today
    7·2 answers
  • Create a new data frame, first_south, by subsetting titanic to include instances where a passenger is in the first class cabin (
    8·1 answer
  • Class ____________ allow you to create one version of a class, without having to replicate code to handle multiple data types.
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!