Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!