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
agasfer [191]
3 years ago
13

Create an enumeration named Month that holds values for the months of the year. With JANUARY equal to 1, FEBRUARY equal to 2, an

d so on through DECEMBER equal to 12. Write a program named MonthNames that prompts the user for a month integer. Convert the user’s entry to a Month value, and display it. Make sure your integer prompt message does not contain any month names (January, etc.) as this will cause the tests to fail! For Example: "Enter a month number >> " does not contain month names and will work properly.
Computers and Technology
1 answer:
maria [59]3 years ago
4 0

Answer:

import java.util.Scanner;

public class Question {    

   public enum Months{

       JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER

   }

   public static void main(String args[]) {

     

     Scanner scan = new Scanner(System.in);

     System.out.println("Enter a month number>>: ");

     int inputNumber = scan.nextInt();

     

     if(inputNumber > 12 || inputNumber < 1){

         System.out.println("Please enter a valid number.");

     } else {

         System.out.println(Months.values()[inputNumber - 1]);

     }

   }

}

Explanation:

The import statement at the top of the class is to help us receive user input via the keyboard. The class was defined named "Question". Then the enum was declared listing all the months. Then the main function was declared. The Scanner object was created as scan, then the user is prompted for input which is assigned to inputNumber. The user input is validated to be within the range of 1 - 12; if it is outside the range, the user shown an error message. If the input is correct, the appropriate month is displayed to the user. To get the appropriate month, we subtract one from the user input because the enum class uses the zero-index counting; it start counting from zero.

You might be interested in
A document format is
anyanavicka [17]

Answer:

A document file format is a text or binary file format for storing documents on a storage media, especially for use by computers. There currently exist a multitude of incompatible document file formats.

Explanation:

8 0
3 years ago
Read 2 more answers
Discuss about the main frame computer​
Nimfa-mama [501]

Answer:

Mainframes (also called "big iron")[1] are powerful computers used for large information processingjobs. They are mainly used by governmentinstitutions and large companies for tasks such as census, industry and consumer statistics, enterprise resource planning, and financial transaction processing. Mainframe computers are specially used as servers on the World Wide Web (WWW). They are distinct from supercomputers.

7 0
3 years ago
SYN scanning is a tactic that a malicious hacker (or cracker) can use to determine the state of a communications port without es
Mashutka [201]

Answer:

A closed port that can not receive request from authorized users.

Explanation:

Networks comprises of end devices, routing and switching devices, servers, technical control devices etc. The communication and interconnection of these devices makes up a secure and resourceful network.

Attackers can exploit loopholes in networks to steal information. The attackers uses the SYN scanning or cracking technique to implement the DOS or denial of service attack.

DOS is used to flood ports on a server in a network, preventing authorized user access, as they steal information to avoid detection.

8 0
4 years ago
At what layer of the osi model does a network switch normally operate?.
Iteru [2.4K]

Answer:

A network switch is a multiport network bridge that uses MAC addresses to forward data at the data link layer (layer 2) of the OSI model.

I hope this helps you :)

5 0
2 years ago
The computer that process data that are represented in the form of discrete values are called​
Vinvika [58]

Answer:

Digital computer

Explanation:

The computer that process data that are represented in the form of discrete values are called digital computer.

7 0
3 years ago
Read 2 more answers
Other questions:
  • In the following statement:
    12·1 answer
  • 50 Points being offered for the fastest and most correct response<br><br> How do I fix this?
    6·2 answers
  • Which sentences in the passage correctly describe a function?
    11·1 answer
  • In the single-site processing, single-site data (SPSD) scenario, all processing must be done on the end user's side of the syste
    10·2 answers
  • Ebba received a message from one of her tech support employees. In violation of company policy, a user had downloaded a free pro
    14·1 answer
  • What are listed in the vertical columns across the top of the Event Editor?
    5·2 answers
  • Clicking the ____ opens the insert function dialog box.
    13·1 answer
  • Why would a user want to resend a message? Check all that apply.
    7·2 answers
  • How does the internet help you to improve your:
    15·2 answers
  • 1. Fill in the blanks with appropriate word. 5°1-5 is a collection of raw unprocessed facts, figures, and symbols ​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!