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
Wite 3 names of computers used in 1st generation of computers?
enyata [817]
Here are some of the computers used in the first generation of computers:
ENIAC
EDVAC
UNIVAC
IBM-701
IBM-650
These are some of the first computers ever that led to today's computers.
5 0
3 years ago
I need help 40 points and brainless
marta [7]

Answer:

the answer is 50

Explanation:

hope that helped

3 0
3 years ago
Meaningful decisions are important to sustaining immersion, but it’s generally considered poor game design to constantly give th
bezimeni [28]

Answer:

Explanation:

Meaningful decisions are important to sustaining immersion, but it's generally considered poor game design to constantly give the player "critical" decisions. Describe a game you know and how it asks the player to make a variety of decisions from the different levels of Tracy Fullerton's Decision Scale.

7 0
3 years ago
The instructions in a program ...
JulsSmile [24]

Answer:

The instructions in a program can only be expressed using a programming language

7 0
3 years ago
A microwave is the only electric device in a 120-volt circuit. If the circuit has 7. 5 amps of current, what is the electric pow
sergij07 [2.7K]

The only electric appliance in a 120-volt circuit is a microwave. If the circuit has a 7. 5 amp current, the microwave's electric output is 900 watts.

<h3>Explain about the microwave's electric output?</h3>

As was previously said, 1000W is the most common microwave wattage . The real power usage of a 1000W microwave, or its average input wattage, is 1402.7W. In a microwave, it is always more important to pay attention to the input wattage than the output wattage.

The energy that can be used in a microwave to heat and cook food is represented by this number. Typically, the power output is expressed in Watts, for example, 900 Watts. The appliance's whole wattage consumption used to produce microwave energy is the input.

A microwave can consume anywhere from 600 to 1,000 watts (W) of power. When connected to a 120-volt outlet, microwaves draw roughly 10 amps. The largest influence on how much electricity your microwave uses over time is how frequently you use it.

To learn more about microwave's electric output refer to:

brainly.com/question/13943474

#SPJ4

4 0
1 year ago
Other questions:
  • how much should an organization consider moving into the cloud before full outsourcing starts making more business sense
    14·2 answers
  • Please write a Java program.
    8·1 answer
  • If it is impractical to place guest users in a secure network, isolated from the production network by firewall barriers, then:
    14·1 answer
  • Ricardo twists his ankle at work but does not immediately realize that he is injured because his ankle is not sore or swollen, a
    5·1 answer
  • When two or more tables share the same number of columns, and when their corresponding columns share the same or compatible doma
    12·1 answer
  • Suppose the message 111010 is to be transmitted (beginning with the leftmost bit) using
    6·1 answer
  • What is the cpu used for
    6·1 answer
  • What is polymerization1​
    11·1 answer
  • Braxton is writing a program to design t-shirts. Which of the following correctly sets an attribute for color?
    7·1 answer
  • What is the main purpose of a web crawling program
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!