EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
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
Write an application named, Lab14.java. This application will do the following: 1. Display an introductory message 2. Choose a random word from the file, wordlist.txt, and display it 3. Disguise the selected word, and display it 4. Ask the user whether to continue, i.e., whether to repeat steps 2, 3, and 4, or quit the application Once the user chooses to stop the application: 5. Display the total number of vowels hidden 6. Display the total number of consonants hidden 7. Display termination message The user will be asked whether to continue playing and will indicate that another game is to be played by answering ‘y’ or ‘Y’ in response to the question, “Want to play again?” asked by the program after displaying each chosen word and its disguised version. If the user’s response is any character other than ‘y’ or ‘Y’, the totals are displayed and then the application termination message is displayed. See examples below. About randomly choosing a word from the file, wordlist.txt, found on…
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.
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
Dictionaries - Introduction to Data Structures (Episode 8); Author: NullPointer Exception;https://www.youtube.com/watch?v=j0cPnbtp1_w;License: Standard YouTube License, CC-BY