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
How i simplify this boolean expression ?A'.B'.C'+A'.B'.C+A'.B.C+A.B'.C+A.B.C
slavikrds [6]

Answer:

A⁵+B⁵+C⁵

A+A+A+A+A= A⁵

B+B+B+B+B=B⁵

C+C+C+C+C= C⁵

8 0
3 years ago
Read 2 more answers
_________ is the method used by password crackers who work with pre-calculated hashes of all passwords possible within a certain
sergij07 [2.7K]

Answer:

DOS, Denail of Service Attacks

Explanation:

5 0
2 years ago
Business Professionals of America, and Future Business Leaders of America – Phi Beta Lambda are both open to business students a
AVprozaik [17]

Answer:

Middle, High and College

Explanation:

8 0
4 years ago
Read 2 more answers
A computer's hard disk drive holds 8 x 10^10 bytes of information. If Jill buys an extra memory stick that holds 5.1 X 10^8 byte
denis-greek [22]

Answer:

The computer will store 8.05 *10^10 bytes of information.

Explanation:

This is the same as saying that the computer will now have 80.51 Gigabytes ( 1gb = 1.000.000.000 bytes) of storage. In this case, the number is represented in its decimal form, and the previous one is displayed in Scientific Notation.

8 0
3 years ago
Which of the following indicates the main benefit of having a larger hard drive on a computer
dem82 [27]
I would say the primary Beni fit is more space for storage , but also it does effect the speed eventually. If your hard drive is almost full, everything will be slower
8 0
4 years ago
Other questions:
  • What area contains the command used to customize the print options in microsoft excel?
    9·1 answer
  • An example of live footage is when?
    10·2 answers
  • Which command group does a user need to access the Formula dialog box?
    11·1 answer
  • Operational feasibility, which refers to user acceptance and support, as well as management acceptance and support, is also know
    9·1 answer
  • Write another function to convert a value to its word equivalent leveraging the following tuple - o Number = (‘One’, ‘Two’, … ‘N
    10·1 answer
  • An administrative assistant types a document, saves, and prints. The assistant is using _____.
    13·1 answer
  • You are an online training company and stream a lot of training videos from your
    12·1 answer
  • This uses the gps methodology to predict the likely location of an offender's base of operation:
    8·1 answer
  • Company Wizzy is having trouble with network security. Issues with authentication, viruses, malware/spyware, and other network i
    12·1 answer
  • ((Excel)) please help, 100 points, and brain crown thingy, not only that, i will make several of these so you can get several hu
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!