Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) Output this exact hourglass to the screen. ########### # # #*****# #***# #*# #*# #*# # * # # * # #*******# ########### (2)

1) Output this exact hourglass to the screen. ########### # # #*****# #***# #*# #*# #*# # * # # * # #*******# ########### (2) Add more code to your program to read user input and display output as described below: First output two blank lines after the hourglass. Then output the following prompt to the user: Enter the current year: Create a Scanner object to use for reading input. Create an integer variable to use for storing the current year read from input. Read the input and store it in the variable you created. Then output the following, including the year that was input. For example, if the input was 2018, the program would output: Time passes... We are now in year 2018 (3) Add more code to calculate and display the next year, and 10 years from now, as follows: Time passes... We are now in year 2018 2019 will be next! And 2028 is a decade away (4) Add more code to your program to read and output a social security number (SSN) as described below: First output one blank line after the previous outputs. Prompt for each part of an SSN, as shown below, and read and store the input parts into the variables already defined in the program code template. Then output one blank line and output the formatted SSN, as follows: Enter first 3 digits of SSN: 111 Enter middle 2 digits of SSN: 22 Enter last 4 digits of SSN: 3333 Formatted SSN [111-22-3333] Note: This zyLab outputs a newline after each user-input prompt. INPUT AND OUTPUT For convenience in the examples above, the user's input value was shown on the next line, but such values don't actually appear as output when the program runs. So the program input for the above examples: 2018 111 22 3333 would be separate from the program output, which would be: ########### # # #*****# #***# #*# #*# #*# # * # # * # #*******# ########### Enter the current year: Time passes... We are now in year 2018 2019 will be next! And 2028 is a decade away Enter first 3 digits of SSN: Enter middle 2 digits of SSN: Enter last 4 digits of SSN: Formatted SSN [111-22-3333]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

=+j Describe the various support services delivered by IHR.

Answered: 1 week ago

Question

=+j Explain IHRMs role in global HR research.

Answered: 1 week ago