
Explanation of Solution
Program:
File name: “DayOfWeek.java”
//Import necessary header files
import java.util.Scanner;
//Define a class named DayOfWeek
public class DayOfWeek
{
//Define an enumerated data type
enum Day {SUN, MON, TUE, WED, THU, FRI, SAT};
//Define main method
public static void main(String[] args)
{
//Declare the variables
Day day;
String userEntry;
int position;
int comparison;
//Declare a string of objects
String[] times = {"11 - 5", "9 - 9", "10 - 6"};
//Create an object for the Scanner class
Scanner input = new Scanner(System.in);
//Print the result
System.out.println("The days are:");
for(Day d : Day.values())
System.out.print(d + " ");
/*Prompt the user to enter the day code to find the business hours for the chosen day*/
System.out.print("\n\nEnter the day code to find our hours >> ");
userEntry = input...

Trending nowThis is a popular solution!

Chapter 9 Solutions
Java Programming (MindTap Course List)
- Design and draw a high-level "as-is" process diagram that illustrates a current process related to a product or service offered through the SSDCI.gov database.arrow_forwardCompare last-mile connections for connecting homes and businesses to the Internetarrow_forwardExplain wireless networking standardsarrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning



