Question: A shipping company uses the following function to calculate the cost (in dollars) of shipping based on the weight of the package (in pounds). Write
A shipping company uses the following function to calculate the cost (in dollars) of shipping based on the weight of the package (in pounds).

Write a program that prompts the user to enter the weight of the package and display the shipping cost. If the weight is greater than 50, display a message ?the package cannot be shipped.?
(3.5, if 0 < w
Step by Step Solution
3.36 Rating (159 Votes )
There are 3 Steps involved in it
Program Plan Create a class called CostOfShipping Initialize the main method with variables weight a... View full answer
Get step-by-step solutions from verified subject matter experts
