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
Enhance the Fahrenheit to Celsius applicationIn this assignment, you’ll add data validation to the application you created in Assignment 1. You’ll also let the user do multiple conversions before ending the application. This is the dialog box for an invalid entry: 1. If you didn’t already do Assignment 1, do it now.2. Add data validation to the application so it won’t do the conversion until the user enters aFahrenheit temperature between -100 and 212. If the entry is invalid, a dialog box like theone above should be displayed.3. Add a loop to the code so the user can do a series of calculations without restarting theapplication. To end the application, the user must enter 999 as the temperature
Implement the "Update player rating" menu option. Prompt the user for a player's jersey number. Prompt again for a new rating for the player, and then change that player's rating. Ex: Enter a jersey number: 23 Enter a new rating for player: 6
Draw the following FlowChart in Raptor and upload the Raptor file into the assignment folder. Draw a table variable (for a, b, M) on a paper assuming the user insert M=7 when it is asked by raptor, and upload it to the assignment folder. Which of the following are final values for n and sum, if the user inserts M=7 when it is asked by Raptor? Capital and Lowercase M is similar in this example (m=M) On paper, write what is the purpose of this algorithm. a = 1, b=2, m=7 a = 2, b=4, m=7 a = 8, b=8, m=7 a = 16, b=16, m=7 a = 16, b=16, m=8
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
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
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