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
_________ is critical to Amazon's success.<br><br> SCM<br><br> JIT<br><br> ERP<br><br> VMI
Minchanka [31]

Answer: SCM

Explanation:

 SCM stand for supply chain management system and it is amazon's competitive strategy. The amazon SCM is the strategic of being the retailer according to the customer's choice.

Inventory system for multi-tier is the major component for the amazon's SCM. The main key aspect for the amazon supply chain management is that  it is responsible for development in the trade market over years.The amazon SCM are basically responsible for analysis all the major growth and productivity ij the market by using the supply chain management process.

8 0
3 years ago
If im downloading a game at 4mb/s how many minutes would it take to download 25 GB
xxMikexx [17]

Answer:

File size  

25  GB  

Connection type Download speed Download time

Modem    28,8 kbit/s                   2071:15:40

Modem     56,6 kbit/s                         1065:13:12

ADSL       256 kbit/s                         233:01:00

ADSL       512 kbit/s                         116:30:30

ADSL       1 Mbit/s                                     59:39:08

ADSL             2 Mbit/s                                     29:49:34

ADSL             8 Mbit/s                                     07:27:23

ADSL             24 Mbit/s                                     02:29:07

LAN             10 Mbit/s                                                 05:57:54

LAN             100 Mbit/s                                     00:35:47

Turbo 3G 7,2 Mbit                           08:17:06

4G             80 Mbit/s                                     00:44:44

Hopefully this helps somewhat

7 0
2 years ago
Read 2 more answers
Which of the items listed is not considered to be personal protective equipment (PPE)?
KatRina [158]

Answer:a

a t t i c

Explanation:

6 0
3 years ago
A(n)<br> is a fast compute with lots of storage. pls help
Pachacha [2.7K]

Answer:

Surface Laptop 3 - 15", Platinum (metal), AMD Ryzen 5 3580U, 8GB, 128GB

4 0
3 years ago
Read 2 more answers
Universal Windows Platform is designed for which Windows 10 version?
Naddika [18.5K]

Universal Windows Platform is an open source API created by Microsoft and first introduced in Windows 10. The purpose of this platform is to help develop universal apps that run on Windows 10, Windows 10 Mobile, Xbox One and HoloLens without the need to be re-written for each. It supports Windows app development using C++, C#, VB.NET, and XAML. The API is implemented in C++, and supported in C++, VB.NET, C#, F# and JavaScript. Designed as an extension to the Windows Runtime platform first introduced in Windows Server 2012 and Windows 8, UWP allows developers to create apps that will potentially run on multiple types of devices.

6 0
3 years ago
Other questions:
  • You have been asked to create an authentication security plan for your company. Which of the following components would you inco
    14·1 answer
  • Businesses sometimes achieve uninterruptible service by using a technology known as ____ to keep a mirror copy of all their data
    11·1 answer
  • A. True
    8·2 answers
  • Which of these is a social consequence of effective communication
    12·1 answer
  • Files with what two file extensions are commonly known as tarballs??
    8·1 answer
  • CAD workstations
    11·1 answer
  • The icon below represents the ____________.
    8·1 answer
  • ............................... ?
    11·1 answer
  • Which type of fiber-optic connector, containing one fiber-optic strand per connector, is connected by pushing the connector into
    7·1 answer
  • Any action that causes harm to your computer is called a
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!