answer.
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
UkoKoshka [18]
2 years ago
6

Create an application that contains an enumeration that represents the days of the week. Display a list of the days, and then pr

ompt the user for a day. Display business hours for the chosen day. Assume that the business is open from 11 to 5 on Sunday, 9 to 9 on weekdays, and 10 to 6 on Saturday. Save the file as DayOfWeek.java.

Computers and Technology
1 answer:
IgorLugansk [536]2 years ago
7 0

Answer:

The program to this question can be defined as below:

Program:

import java.util.*; //import package for user input

enum Days{Sunday, Monday, Tuesday, Wednesday, Thusday, Friday, Saturday} //defining enum

public class DayOfWeek //defining class DayOfWeek

{

  public static void main(String[] args) //defining main method

  {

  System.out.println("Days of the Week: "); //print message  

  for (Days d : Days.values()) //defining for loop to print enums values

  {

  System.out.print(d+"\n");//print values

  }

  System.out.println("Enter your day: "); //print message

  Scanner obx= new Scanner(System.in); //create Scanner class object for user input

  Object d= obx.next(); //create object to hold user-input value

  System.out.print("Business Hours "); //print message

   //check conditions  

  if(Days.Sunday.toString().equals(d)) //defining if block to check if day is Sunday

  {

  System.out.println("from 11 to 5"); //print message

  }

  else if(Days.Saturday.toString().equals(d))// check if the day isn't Sunday

  {

  System.out.println("from 10 to 6");  //print message

  }

  else //else block

  {

      System.out.println("from 9 to 9");//print message

  }

  }

}

Output:

please see the attachment.

Explanation:

In the given code first package is import for user input then the enumeration "Days" is used, in which weekday values are defined. In the next line, the class "DayOfWeek" is defined, in this main method is declared, that first uses a loop to print enum value than it will create object "d" for user input and define conditional statement to check values, that can be described as follows:

  • In the if block it will check if the input value is "Sunday", it will print 11 to 5 business hours, otherwise, it will go to the else if block.
  • In this block it will check, that input value is "Saturday", if it is true it will print 10 to 6 business hours.
  • If both above condition is false so, it will print 9 to 9 business hours.

You might be interested in
Which bus slot provides highest video performance​
Tresset [83]

Answer:

The best slot to use for video cards is the PCI-Express x16 slot. The next best is the AGP slot. The next best is a PCI-Express x1 slot but video cards which fit that slot are very hard to find as of late 2006. The worst choice for a video card is a PCI slot.

4 0
2 years ago
1.the following code example would print the data type of x, what data type would that be?
natta225 [31]

Answer:

x = 5, the data type is integer( integer data type is for whole numbers)

2. The data type is string

3. The data type is float (float data type is for decimals)

Explanation:

6 0
2 years ago
In __________ mode, the data within an ip packet is encrypted, but the header information is not.
Anvisha [2.4K]

Answer:

Transport mode

Explanation:

The host-to-host transport mode of internet protocol security (IPsec) is mostly used between two host devices or between a user and a server. When you go online and Google something, what you have done is send a packet request to a server. The IPsec’s transport mode offers secure protection to parts of this IP packet. The packet consists of the original IP header and an IP payload (TCP header and data). In transport mode, only the IP payload is encrypted. The original IP header is not.

6 0
2 years ago
This program finds the sum and average of three numbers. What are the proper codes for Lines a and b?
Gennadij [26K]

Answer:

The Proper codes in Line a and Line b is given below

average=Sum/3  

print (" Average is = ", average)

Explanation:

In the given question it calculated the sum but the program does not calculate the average of the 3 numbers.The average of the 3 number is calculated by using average=Sum/3   statement so we add this code in Line a then After that print the value of average by using the print function so we add this code in Line b.

4 0
2 years ago
Read 2 more answers
"In Windows, what two terms describe the active partition on an MBR drive, and the location where the Windows operating system i
Oxana [17]

Answer:

Boot partition and system partition

Explanation:

System partition is the primary partition that is used as the active boot partition,it saves boot files and all files that will be used.  System partition is also known as the system directory or root directory and is usually given the identifier "c"

Boot partition is the disk partition that holds the files for the operating system files Windows operating system (either XP, Vista, 7, 8, 8.1 or 10), it works with the system partition and tells the computer where to look when starting. It given the identifier of letter "D" or "E"

5 0
2 years ago
Read 2 more answers
Other questions:
  • What is the 5 basic steps of computer programing?
    6·1 answer
  • Marissa works at a company that makes perfume. She noticed many samples of the perfume were not passing inspection. She conducte
    6·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • Days of the week are represented as three-letter strings ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"). Write a javaScript f
    14·1 answer
  • Which use case can be accomplished using a custom link? Choose 3 ans A. Navigate to a process to update the current record. B. N
    10·1 answer
  • Which mechanisms do we use to transport binary data and memory addresses?
    7·1 answer
  • Sarah works in a coffee house where she is responsible for keying in customer orders. A customer orders snacks and coffee, but l
    13·2 answers
  • Show how the recursive multiplication algorithm computes XY, where X = 1234 and Y = 4321. Include all recursive computations.
    11·1 answer
  • given the numerical value 1010101.11, which of the following number systems is most likely represented.
    11·1 answer
  • Write a cout statement that prints the value of a conditional expression. The conditional expression should determine whether th
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!