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
If you delete a shortcut from your desktop, have you also deleted the original file?
svet-max [94.6K]

Answer:

no

Explanation:

it just deletes the icon.

4 0
3 years ago
Read 2 more answers
3. Find the product of (a² +3a+5) x (a+7)​
sergij07 [2.7K]

Explanation:

(a^2 + 3a +5) × (a + 7)

= a^3 + 7a^2 + 3a^2 + 21a + 5a + 35

= a^3 + 10a^2 + 26a + 35

3 0
3 years ago
Directory servers from different vendors are synchronized through ________.
andriy [413]
With a little digging I've done, finding this question with different answers the one you want is D. none of the above
6 0
3 years ago
__ is/are the amount of blank space between lines of text in a paragraph
Natali [406]
Indents? Double Space? one of those
5 0
3 years ago
Read 2 more answers
Identify the correct sequence of steps to change the font from Verdana to Arial.
Luden [163]
Go to your text and scroll until you find your preferred text
3 0
3 years ago
Other questions:
  • A digital footprint is all of the information on-line about a person posted by that person or others, ____________. intentionall
    14·1 answer
  • What are examples of some Exotic currencies?
    14·1 answer
  • Which audio editing effect uses the option ""Get Profile"" to execute its function?
    6·1 answer
  • What is batch processing?
    12·1 answer
  • My mac book airs touch pad stopped working and i can't click. what do i do?
    5·2 answers
  • What is the name for the type of flash memory that is used by mobile devices to store their apps and data?
    6·1 answer
  • Limitations of the information systems used by tesco​
    7·1 answer
  • Software that was designed to serve the needs of a specific company or organization is called:
    11·1 answer
  • Which line correctly starts the definition of a class named "team"?
    7·1 answer
  • When we look for errors inside of our code on our own or with a partner , what is that called?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!