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
What do you do when ur grounded from all electronics and can't go outside and have t clean all day
MAXImum [283]

Answer:

read, write, draw!

Explanation:

It would be fun!

6 0
3 years ago
The network administrator has configured the enterprise firewall to permit port 21 to allow FTP transfers to occur from outside
mars1129 [50]

Answer:

The answer is "Port 20 must be authorised, along with Port 21."

Explanation:

It could be used to transfer data all machines on a computer, as only the title suggests. It can be used to exchange information across user accounts, transfer data to the server software records.

  • The firewalls use network enterprise to described as stand-alone IPSec and VPN, which provide extensive gateway and control capability to secure network connections.
  • It provides the set up for the system administrator, which enables the port 21 for FTP payments within the company.
7 0
3 years ago
In a dark place you have only a match , a twig , campfire logs , and oil lamp and a candle which do you literally first /
ohaa [14]

Answer:

You would use a twig first :)

Explanation:

3 0
3 years ago
You receive an e-mail that seems to come from your bank. Clicking on a link in the message takes you to a website that seems to
lions [1.4K]

Answer:

A Phishing Attack

Explanation:

The term "phishing" comes from the combination of the English term "fishing", which means to fish, with the term "phreak", often used to name the first telephony hackers.

It is a type of scam that uses technological mechanisms, usually based on messages, to persuade and deceive people, with a specific objective, which varies from attack to attack.

For example, sending you an email message with a link like a popular social media platform which is meant to trick you into submitting your login details thereby hacking into your account from the hacker's remote location.

3 0
3 years ago
Read 2 more answers
Write a method named countMatching(). It has two parameters: a String and a character. The method returns a count of how many ti
andreev551 [17]

Answer:

Check the explanation

Explanation:

public static int countMatching(String s, char c) {

   int count = 0;

   for (int i = 0; i < s.length(); i++) {

       if (s.charAt(i) == c)

           ++count;

   }

   return count;

}

Method in a complete Java program

public class FizzBuzz {

/* sample run:

    * z appears 2 time(s) in FIZZbuzz

    */

   public static void main(String[] args) {

       String s = "FIZZbuzz";

       char c = 'z';

       int count = countMatching(s, c);

       System.out.printf("%c appears %d time(s) in %s%n", c, count, s);

   }

   // Put your countMatching() method here:

   public static int countMatching(String s, char c) {

       int count = 0;

       for (int i = 0; i < s.length(); i++) {

           if (s.charAt(i) == c)

               ++count;

       }

       return count;

   }

}

z appears 2 time(s) in FIZZbuzz Process finished with exit code

4 0
4 years ago
Other questions:
  • Monica needs a printer to use at home. She wants fine-quality prints at an affordable cost. Which printer will help her achieve
    9·1 answer
  • A(n) ________ is installed on your computer, and when the program is opened, your e-mail is downloaded to your computer. web-bas
    14·1 answer
  • List seven basic internal components found in a computer tower
    13·1 answer
  • When considering the best technology for its particular use what should a business consider
    8·2 answers
  • In your memo, give three new employees directions for starting the computer and opening a word-processing document.
    9·1 answer
  • Which column and row references are updated when you copy the formula: =F$5+12?
    14·1 answer
  • This instrument records seismic waves on a roll of paper. The recording is called a(n) _____.
    8·1 answer
  • Pleases Help ME An example of a _________________ impact is when a product is back ordered and the business contacts the custome
    5·1 answer
  • Define computer memory and write its type <br>​
    10·2 answers
  • How to get an object from a container in java.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!