Programming Homework Help

Dallas College Create a Java Code Computer Programming Task

 

Problem Description:

RedEx Corp., a major shipping company has hired you develop a program that computes the shipping cost of packages based on the weight of the package. The company uses the following weight-based rule to compute the shipping cost:

3.75 + ????h? ? 1.25, ?? 0 < ????h? ? 15 ?????h?????? = – 8.50 + (????h? ? 7) ? 1.75, ?? 15 < ????h? ? 25

10.75 + (????h? ? 12) ? 2.25, ?? 25 < ????h? ? 35

Write a program that reads the full name of the user. Next, the program prompts the user to enter the weight of the package and then using the above rule, computes the shipping cost. If the weight of the package is greater than 35, the program should display a message informing the user that the package cannot be shipped. If the weight of the package is 0 or below, the program should display a message informing the user that the weight is not valid.

Sample Runs:

Enter your full name: Billie Eilish
Enter package weight: 8.8
Billie, the total cost for your package is 14.75

Enter your full name: Daenerys Targaryen
Enter package weight: 19.2
Daenerys, the total cost for your package is 29.85

Enter your full name: Bilbo Baggins Enter package weight: 45.2
Bilbo, the package cannot be shipped.

Hints:

Usetheappropriatedatatypetoreadthefullnameandpackageweightenteredby the user.

Extractthefirstnameusingtheappropriatemethodsfromthefullname.

Use the appropriate logical operator to evaluate the range in which the packageweight falls.

Makeuseofthemulti-wayif-elsestatementstodisplaytheappropriateoutput.

Deliverables:

Your .java file including:

1. A sample run with username as “Albus Dumbledore” and package weight as “23.8”. Include this sample run as a comment on top of your Java code.