MINDTAPV2.0 JAVA PROGRAMMING 2021, 1TERM
MINDTAPV2.0 JAVA PROGRAMMING 2021, 1TERM
9th Edition
ISBN: 9780357505526
Author: FARRELL
Publisher: CENGAGE L
bartleby

Videos

Expert Solution & Answer
Book Icon
Chapter 9, Problem 8PE

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...

Blurred answer
Students have asked these similar questions
Solve in MATLAB
Hello please look at the attached picture. I need an detailed explanation of the architecture
Information Security Risk and Vulnerability Assessment 1- Which TCP/IP protocol is used to convert the IP address to the Mac address? Explain 2-What popular switch feature allows you to create communication boundaries between systems connected to the switch3- what types of vulnerability directly related to the programmer of the software?4- Who ensures the entity implements appropriate security controls to protect an asset?         Please do not use AI and add refrence
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Dictionaries - Introduction to Data Structures (Episode 8); Author: NullPointer Exception;https://www.youtube.com/watch?v=j0cPnbtp1_w;License: Standard YouTube License, CC-BY