EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Concept explainers

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

Explanation of Solution

Program:

File name: “Majors.java

//Import necessary header files

import java.util.Scanner;

import java.util.ArrayList;

//Define a class named Majors

public class Majors

{

    //Define an enumerated data type

    enum Major {ACC, CHEM, CIS, ENG, HIS, PHYS};

    //Define main method

    public static void main(String[] args)

    {

        //Declare the variables

        Major studentMajor;

        String userEntry;

        int position;

        int comparison;

        //Create an object for the Scanner class

        Scanner input = new Scanner(System.in);

        //Print the result

        System.out.println("The majors we offer are:");

        for(Major m : Major.values())

            System.out.print(m + " ");

        //Prompt the user to enter the major

        System.out.print("\n\nEnter your major >> ");

        userEntry = input.nextLine().toUpperCase();

        studentMajor = Major.valueOf(userEntry);

        //Print the result

        System.out...

Blurred answer
Students have asked these similar questions
8. Astronomy HelperCreate an application that displays the following data about the planets of the solar system (including Pluto, which is no longer considered a planet). (For your information, the distances are shown in AUs, or astronomical units. 1 AU equals approximately 93 million miles. In your application simply display the distances as they are shown here, in AUs.)MercuryType TerrestrialAverage distance from the sun 0.387 AUMass 3.31 * 1023 kgSurface temperature -173°C to 430°CVenusType TerrestrialAverage distance from the sun 0.7233 AUMass 4.87 * 1024 kgSurface temperature 472°CEarthType TerrestrialAverage distance from the sun 1 AUMass 5.967 * 1024 kgSurface temperature -50°C to 50°CMarsType TerrestrialAverage distance from the sun 1.5237 AUMass 0.6424 * 1024 kgSurface temperature -140°C to 20°CJupiterType JovianAverage distance from the sun 5.2028 AUMass 1.899 * 1027 kgTemperature at cloud tops -110°CSaturnType JovianAverage distance from the sun 9.5388 AUMass 5.69 * 1026…
Pendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that contains the author’s name, the title of the work, and a volume number in the form Volume 9 of 9. For example, a set of three volumes requires three labels: Volume 1 of 3, Volume 2 of 3, and Volume 3 of 3. Design an application that reads records that contain an author’s name, the title of the work, and the number of volumes. The application must read the records until eof is encountered and produce enough labels for each work. The flowchart must include a call symbol, at the beginning, to redirect the input to the external data file.                             create a solution algorithm using pseudocode create a flowchart using RAPTOR
Pendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that contains the author’s name, the title of the work, and a volume number in the form Volume 9 of 9. For example, a set of three volumes requires three labels: Volume 1 of 3, Volume 2 of 3, and Volume 3 of 3. Design an application that reads records that contain an author’s name, the title of the work, and the number of volumes. The application must read the records until eof is encountered and produce enough labels for each work. Design a flowchart and psuedocode Pendant Publishing.
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
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
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 with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning