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
The key to security policy is being able to measure compliance against a set of controls. Security controls define _____ ______
Virty [35]

Answer:

The correct words for the blank spaces are: how; why.

Explanation:

In computer science, security control implies all the efforts of how organizations prevent, detect, and attack risks to safeguard sensitive information. Security policies establish why those actions are taken and set a list of all the assets that must be protected in front of a breach.

8 0
4 years ago
Como afecta la robotizacion en las empresas?
kirill [66]

Yo llamaria a esto automatizacion.

Puede reducir los costos al permitir que la empresa emplee a menos personas.

8 0
3 years ago
A _____ is a description that involves "telling" the database management system (DBMS) the logical and physical structure of the
alexandr402 [8]

Answer:

the right answer to the question is schema

Explanation:

The database schema of a database is its structure described in a formal language supported by the database management system (DBMS). The term "schema" refers to the organization of data as a blueprint of how the database is constructed

5 0
3 years ago
Laura is confused with the spelling of the word pronunciation. She types the word pronunciation. Which feature of the auto corre
larisa [96]
I think this answer is b
5 0
3 years ago
Read 2 more answers
Mara is a network system analyst for a large investment firm. What kind of
Alchen [17]

Mara is a network system analyst for a large investment firm. The education that Mara would have needed to achieve this position is  a bachelor's degree in computer science

Explanation:

  • Network systems analysts monitor and maintain computer hardware and software applications for businesses and organizations.
  • They specialize in the infrastructural design of the network and analyze the performance of these systems to best improve it.
  • The network system analyst also research and report the costs of upgrading or replacing the current networking technology used within a business.
  • Most bachelor's programs require completion of general education courses in mathematics, English and statistics.
  • Employers require systems analyst applicants to have at least a bachelor's degree in computer systems analysis, computer science, computer information systems, management information systems, business intelligence or a similar field of study.
  • A network analyst should hold a bachelor's degree in a field related to programming, information assurance, or computer science as a minimum.
  • The new criteria include the employers to look for those who hold a master's degree with the master of business administration.
8 0
3 years ago
Other questions:
  • Do you believe that OOP should be phased out and we should start working on some alternative(s)?
    6·1 answer
  • The ____ feature automatically locates specific text and then replaces it with desired text. Find and Replace Locator Locate and
    6·1 answer
  • Every computer consists of physical components and nonphysical components. the nonphysical components of a computer that underst
    9·1 answer
  • Computer trespass can be harmless.<br> a. True<br> b. False
    15·2 answers
  • PLEASE HURRYYY Suppose your employer wants you to purchase a tablet device that you will use to run the company's custom sales s
    15·2 answers
  • Which of these personal protective equipment items prevents injury from falling objects ?
    15·1 answer
  • The Fast as Light Shipping company charges the following rates. Weight of the item being sent Rate per 100 Miles shipped 2kg or
    13·1 answer
  • Assume a large shared LLC that is tiled and distributed on the chip. Assume that the OS page size is 16KB. The entire LLC has a
    8·1 answer
  • Polynomial regression A common misconception is that linear regression can only be used to fit a linear relationship. We can fit
    11·1 answer
  • What is a table in Excel?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!