Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java Coding ! Strings and Formatting Write the program that does the following: 1. Prompts the User for their first name. 2. Prompts the

In Java Coding !

Strings and Formatting

Write the program that does the following:

1. Prompts the User for their first name.

2. Prompts the User for their last name separately from their first.

3. Prompts the User for how many hours of sleep they get per 24 hour period (this would include any naps if one is taken).

4. Prompts the User to enter how much money they would like to earn per hour.

5. Extract the first initial of the first name and convert it to a lower case. You must convert - don't try to avoid this by entering the name with a lower case for the first character.

6. Extract the first initial of the last name and convert it to a lower case. You must convert - don't try to avoid this by entering the name with a lower case for the first character.

7. Compute the percentage of the number of hours in a 24 hour period the User sleeps.

8. Format this value to print as a percentage.

9. Compute a 40 hour per week salary based on the hourly rate the User entered.

10. Format the salary as currency.

11. Display the following message: sleeps of each 24 hour period and would like to earn per week.

12. Test your program to make sure it displays the output as shown in step 11. NOTE: 1. Declare all variables within the data declaration section. 2 Do not get input on the same line as a variable declaration. 3. Do not place an equation for computation on the same line as declaring a variable.

Click on the "Attachment" button to upload the .java file.

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

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

Draw and explain the operation of LVDT for pressure measurement

Answered: 1 week ago

Question

Strong analytical, communication, and problem-solving skills

Answered: 1 week ago