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]
3 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]3 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]3 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
Technology changes rapidly. Do you think the development of new technology will slow down at some point? At some point will cons
KiRa [710]

Answer:

1st question=no

2nd question=consumer will never be satisfied.Unless the technology is super strong that nothing can stop it

3rd question=almost everything,first they build technology because they want humans life to be easy.

wish it helps

7 0
3 years ago
The ___________ method returns the length of an array.
MaRussiya [10]

Answer:

A. Append

Explanation:

4 0
3 years ago
Read 2 more answers
It keeps saying “something is going wrong oops!” when i click on my brainly notifications what do I do
AveGali [126]

Answer:

check your app permissions it may be blocking them or try resetting the app

4 0
3 years ago
Tom's Art Supplies used to sell art supplies through mail order catalogs, but the company's order takers often had difficulty de
olganol [36]
The answer is:bbbbbbbb
6 0
3 years ago
When using linear or reciprocal navigation, what should be the interface include?
Alex_Xolod [135]
The answer to the question is A
5 0
3 years ago
Other questions:
  • 3. Discuss the disadvantages of file-based systems.
    13·1 answer
  • The Cisco IOS automatically modifies the dead interval when the _____ interval is changed. (Points : 2) hello
    13·1 answer
  • What is the difference between a sequential program and an event-driven program?
    9·1 answer
  • We want to transmit 40 packets and the following packets are getting lost, 3,9, 25,28, 35. How many rounds are needed if
    5·1 answer
  • Cho 3 lớp như hình, viếtchương trình thực hiện các chức năng sau:
    15·1 answer
  • c) If you are at foreign country visit, which banking card would you prefer to keep with you during visit (Debit Card or Credit
    10·1 answer
  • X274: Recursion Programming Exercise: Cannonballs Spherical objects, such as cannonballs, can be stacked to form a pyramid with
    7·1 answer
  • Can you explain the difference between software and hardware? Tell me 3 examples of each one.
    10·1 answer
  • Steps for Saving and opening a document.​
    14·1 answer
  • 30 POINTS FOR THE CORRECT ANSWERS
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!