Question: Write a java program that prompts the user to enter the weight of an item in ounces and the price per pound. Then ask user

Write a java program that prompts the user to enter the weight of an item in ounces and the price per pound. Then ask user to enter his/her name (User can enter a string with any order of lower/upper case characters).The name will include their first and last name with a space between them. Note that the name will be saved in one string variable. Do not use two different variables for first name and last name. Your program should calculate the items weight in pounds then calculate the cost of buying an item. 1 Pound = 16 Once Then generate a two-digit random number as a confirmation code. Your program should convert the users name to all uppercase characters and replace the space between first and last names with a period (.). Your code should print a receipt that includes the cashiers name (all uppercase with a period for separating the first and last name) and the confirmation code. The output should also include the unit price, weight in pounds and the total price. You should use NumberFormat to print any currency and DecimalFormat with 2 decimal places for printing the weight.

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!