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

Videos

Question
Book Icon
Chapter 5, Problem 10PE
Program Plan Intro

The Twelve Days of Christmas

Program plan:

  • Import necessary package.
  • Create a class “TwelveDays”,
    • Define the method “main ()”,
      • Declare the necessary variables.
      • Assign the value returned from the method “get_Choice()”.
      • Check whether the choice is greater than or equal to “4”,
        • Set the suffix to “th”.
      • Otherwise, check whether the choice is “3”,
        • Set the suffix to “rd”.
      • Otherwise, check whether the choice is “2”,
        • Set the suffix to “nd”.
      • Otherwise,
        • Set the suffix to “st”.
      • Print the choice with the day of Christmas song.
      • Execute switch statement for the given choice,
        • If the choice is “12”,
          • Print the corresponding messages until “break” occurs.
            • If the choice is “11”,
              • Print the corresponding messages until “break” occurs.
            • If the choice is “10”,
              • Print the corresponding messages until “break” occurs.
            • If the choice is “9”,
              • Print the corresponding messages until “break” occurs.
            • If the choice is “8”,
              • Print the corresponding messages until “break” occurs.
            • If the choice is “7”,
              • Print the corresponding messages until “break” occurs.
            • If the choice is “6”,
              • Print the corresponding messages until “break” occurs.
            • If the choice is “5”,
              • Print the corresponding messages until “break” occurs.
            • If the choice is “4”,
              • Print the corresponding messages until “break” occurs.
            • If the choice is “3”,
              • Print the corresponding messages until “break” occurs.
            • If the choice is “2”,
              • Print the corresponding messages until “break” occurs.
            • If the choice is “1”,
              • Print the corresponding messages until “break” occurs.
              • Exit the switch using “break”.
            • If invalid choice entered, print invalid message by default.
    • Define the method “get_Choice()”,
      • Declare the necessary variables.
      • Assign the value entered into the dialog box.
      • Parse the input.
      • Return the choice.

Blurred answer
Students have asked these similar questions
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.
design pattern question :- Using the state pattern, you have to implement an application that help track the item ordered from online shop. The client orders an item from online shop, then item can go to post office, then it will be delivered to the user home. Or the item after being ordered it goes to the post office, then the user will pick it up from the post office. In both cases; either take the item from the post office or has it delivered to the client's home represents the end of the process.    Q1)Draw the state diagram that shows all possible states and transitions?   Q2)  Write code of the Ordered state? Q3)  Write the implementation of the ShopOrder class; most important things are the states declaration, the constructor, a function to return robot state
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
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
CPP Function Parameters | Returning Values from Functions | C++ Video Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=WqukJuBnLQU;License: Standard YouTube License, CC-BY