1. Import the scanner class from the java.util package. 2. Define a public class named Zodiacsign....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Import the scanner class from the java.util package. 2. Define a public class named Zodiacsign. 3. Define the main method within the ZodiacSign class. 4. Create a new instance of the scanner class to read user input. 5. Prompt the user to enter their birth month (1-12) and store the value in the month variable. 6. Prompt the user to enter their birth day (1-31) and store the value in the day variable. 7. Close the scanner to release system resources. 8. Create an empty string variable zodiac sign to store the calculated zodiac sign. 9. Use a switch statement to determine the zodiac sign based on the user's input month. 10. For each case (month), use nested if-else statements to further determine the zodiac sign based on the day of birth (refer to the Astrological sign table below). 11. Set the appropriate Unicode character for the zodiac sign based on the determined sign and assign it to the zodiacsign variable. 12. Break out of the switch statement after each case is evaluated. 13. Use a default case in the switch statement to handle an invalid month input. 14. Finally, display the calculated zodiac sign using the system.out.println statement. Here is a comprehensive list of astrological signs along with their corresponding Unicode symbols and time periods: Zodiac Sign Aquarius Pisces Aries Taurus Gemini Cancer Leo mg Virgo Libra mScorpio Sagittarius Capricorn String sign Symbol U+2652 = U+2653 U+2649 U+264A U+2648 Mar 21 - Apr 19 Apr 20 - May 20 May 21 - Jun 20 Jun 21 - Jul 22 U+264B U+264C U+264D U+264E U+264F U+2650 U+2651 Period Jan 20 - Feb 18 "\u264C"; . Feb 19 Mar 20 Jul 23 - Aug 22 Aug 23 - Sep 22 Sep 23 Oct 22 Oct 23 - Nov 21 Note: To print or store a zodiac sign in your program, use the \u escape sequence followed by the four hexadecimal digits representing the Unicode code point of that specific character. For instance, to print the Gemini sign, you can use System.out.print("\u264A"); . If you want to store the Leo sign in a variable, you can do so by assigning it like this: Nov 22 - Dec 21 Dec 22 - Jan 19 Below is a sample output of what your code should display when it is executed: Enter the month of birth (1-12): 6 Enter the day of birth (1-31): 22 Your zodiac sign is: Cancer 1. Import the scanner class from the java.util package. 2. Define a public class named Zodiacsign. 3. Define the main method within the ZodiacSign class. 4. Create a new instance of the scanner class to read user input. 5. Prompt the user to enter their birth month (1-12) and store the value in the month variable. 6. Prompt the user to enter their birth day (1-31) and store the value in the day variable. 7. Close the scanner to release system resources. 8. Create an empty string variable zodiac sign to store the calculated zodiac sign. 9. Use a switch statement to determine the zodiac sign based on the user's input month. 10. For each case (month), use nested if-else statements to further determine the zodiac sign based on the day of birth (refer to the Astrological sign table below). 11. Set the appropriate Unicode character for the zodiac sign based on the determined sign and assign it to the zodiacsign variable. 12. Break out of the switch statement after each case is evaluated. 13. Use a default case in the switch statement to handle an invalid month input. 14. Finally, display the calculated zodiac sign using the system.out.println statement. Here is a comprehensive list of astrological signs along with their corresponding Unicode symbols and time periods: Zodiac Sign Aquarius Pisces Aries Taurus Gemini Cancer Leo mg Virgo Libra mScorpio Sagittarius Capricorn String sign Symbol U+2652 = U+2653 U+2649 U+264A U+2648 Mar 21 - Apr 19 Apr 20 - May 20 May 21 - Jun 20 Jun 21 - Jul 22 U+264B U+264C U+264D U+264E U+264F U+2650 U+2651 Period Jan 20 - Feb 18 "\u264C"; . Feb 19 Mar 20 Jul 23 - Aug 22 Aug 23 - Sep 22 Sep 23 Oct 22 Oct 23 - Nov 21 Note: To print or store a zodiac sign in your program, use the \u escape sequence followed by the four hexadecimal digits representing the Unicode code point of that specific character. For instance, to print the Gemini sign, you can use System.out.print("\u264A"); . If you want to store the Leo sign in a variable, you can do so by assigning it like this: Nov 22 - Dec 21 Dec 22 - Jan 19 Below is a sample output of what your code should display when it is executed: Enter the month of birth (1-12): 6 Enter the day of birth (1-31): 22 Your zodiac sign is: Cancer
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class ZodiacSign public static void mainString a... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
How many numbers from 0 to 999 Hint: Think of such numbers as 3-digit strings, with leading 0-s if necessary. Explain briefly are even? are even and have distinct digits? have exactly one digit 9?
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Westile Company buys plain ceramic tiles and prints different designs on them for souvenir and gift stores. It buys the tiles from a small company in Europe, so at all times it keeps on hand a stock...
-
A fishnet consists of 1-mm-diameter strings overlapped and knotted to form 1- by 1-cm squares. Estimate the drag of 1 m2 of such a net when towed normal to its plane at 3 m/s in 20C seawater. What...
-
Find the equation of the plane containing the line x = 1 + 2t, y = -1 + 3t, z = 4 + t and the point (1, -1, 5).
-
Bickley Academy is a competitive private college preparatory high school. Bickleys administration is now considering applications from the three local junior high schools: Montgomery, Cleeghorn, and...
-
Create a set of use cases for the accompanying dentist office system, but do not bother to identify the steps within each use case. (Just complete the information at the top of the use case form.)...
-
Suppose you are tracking objects floating in the ocean. The ocean currents can be variable, so you've modeled the system as a directed graph G, where each vertex representing a region of ocean can...
-
REI sells snowboards. Assume the following information relates to REI's purchases of snowboards during September. During the same month, 100 snowboards were sold. REI uses a periodic inventory...
-
Consider an economy where aggregate output Y is produced using capital K and labour L according to the production function YK"L", where is a parameter with 0 < a < 1. The change in the capital stock...
-
No, the taxpayer does not need to multiply the first-year table depreciation percentage by one-half. This is because first-year depreciation is built into the table, as it is already known. In the...
-
When Implicit Bias Becomes Explicit | Megan Fuciarelli Please carefully watch the TedxTalk below and respond to the following questions https://youtu.be/ww6k3nFe800 What is implicit bias? What is...
-
Jason is considering two different jobs that he has been offered and he likes the atmosphere and other employees equally at both companies. With the first job he would be an apartment property...
-
In this discussion you are invited to consider and reflect upon either your best team experience, or your worst team experience. Your choice of experience to reflect upon can originate from any type...
-
5 Deadly Diseases discussion board 2-5-23 in week 3 discussion board Provide one detailed example of each of the 5 deadly diseases that current management still suffers from 35 year after this video...
-
Ques + A unifarm catenary of lengen I, is suspended from tun in same horizontal line, If the tension at A is twice that at the lowest point show that (2+3) points A and B. the span AB is AZ
-
Burberrys competitive advantage is through its differentiation strategy. What risk should Burberry remain aware of?
-
Write a program to display the text Java is fun and Java is powerful alternately with a mouse click.
-
Write a JSF program that views, inserts, and updates staff information stored in a database, as shown in Figure 33.32. The view button displays a record with a specified ID. The Staff table is...
-
Implement the following method to sort the columns in a twodimensional array. A new array is returned and the original array is intact.public static double[][] sortColumns(double[][] m)Write a test...
-
An iceberg (specific gravity 0.917) floats in the ocean (specific gravity 1.025). What percent of the volume of the iceberg is under water?
-
Obtain a photograph/image of a situation in which Archimedes's principle is important. Print this photo and write a brief paragraph that describes the situation involved.
-
A floating 40-in.-thick piece of ice sinks 1 in. with a \(500-\mathrm{lb}\) polar bear in the center of the ice. What is the area of the ice in the plane of the water level? For seawater, \(S=1.03\).
Study smarter with the SolutionInn App