A shipping company uses the following function to calculate the cost (in dollars) of shipping based on
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 program that prompts the user to enter the weight of the package and displays the shipping cost. If the weight is negative or zero, display a message “Invalid input.” If the weight is greater than 20, display a message “The package cannot be shipped.”
Transcribed Image Text:
3.5, if 0 < w <= 1 5.5, if 1 < w <= 3 c(w) 8.5, if 3 < w <= 10 10.5, if 10 < w <= 20
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 85% (14 reviews)
import javautilScanner public class Exe...View the full answer
Answered By
Sufiyan Ahmed Tariq
I am a Chartered Accountant and an Associate Public & Finance Accountant. I also hold a bachelors of Commerce degree. I have over 8 years of experience in accounting, finance and auditing. Through out my career, I have worked with many leading multinational organisation.
I have helped a number of students in studies by teaching them key concepts of subjects like accounting, finance, corporate law and auditing. I help students understanding the complex situation by providing them daily life examples.
I can help you in the following subject / areas:
a) Accounting;
b) Finance;
c) Commerce;
d) Auditing; and
e) Corporate Law.
4.90+
7+ Reviews
17+ Question Solved
Related Book For
Introduction To Java Programming And Data Structures Comprehensive Version
ISBN: 9780136520238
12th Edition
Authors: Y. Daniel Liang
Question Posted:
Students also viewed these Computer science questions
-
Write a program that prompts the user to enter three strings. Compare the String objects lexicographically and print the middle-valued string. For example, if the three strings were "abcd", "wxyz",...
-
Write a program that prompts the user to enter the radius of the rings and draws an Olympic symbol of five rings of the same size with the colors blue, black, red, yellow, and green. code and run...
-
Write a program that prompts the user to enter the length from the center of a pentagon to a vertex and computes the area of the pentagon, as shown in the following figure. The formula for computing...
-
Fox rented a house from Chiodini, but before he moved in, he noticed exposed electrical wiring in the basement, so he refused to move in. City inspectors confirmed a code violation and Chiodini fixed...
-
Draw a block diagram for the following model. The output is X(s) the inputs are F(s) and G(.v). Indicate the location of Y(s) on the diagram. = y - 5x + g(t) = I0f(t) - 30x
-
The Reliable Aircraft Company manufactures small, pleasure-use aircraft. Based on past experience, sales volume appears to be affected by changes in the price of the planes and by the state of the...
-
Refer to the statement of cash flows for Harley-Davidson in Appendix A for the fiscal year ended December 31, 2002, to answer the following: 1. What amount of cash is used to purchase property and...
-
Squeezers Juice and Tea Company manufactures juices and chai teas that are sold at organic foods stores. Several of its products have been featured in movies because the companys products are popular...
-
Which data set has the greatest spread? Set A-(84, 91, 87, 77, 94, 89, 74} Set B-{89, 73, 84, 91, 87, 77, 94} Set C-{73, 84, 89, 88, 77, 91, 87, 90} Set D (84, 89, 88, 82, 91, 87, 99} -
-
Consider the hypothetical eutectic phase diagram for metals A and B, which is similar to that for the lead-tin system, Figure 9.8. Assume that (1) and phases exist at the A and B extremities of the...
-
Revise Listing 3.8, Lottery.java, to generate a lottery of a threedigit integer. The program prompts the user to enter a three-digit integer and determines whether the user wins according to the...
-
Write a program that generates three random points on a circle centered at (0, 0) with radius 40 and displays three angles in a triangle formed by these three points, as shown in Figure 4.4a. Display...
-
The Consumer Confidence Index (CCI) attempts to measure peoples feelings about general business conditions, employment opportunities, and their own income prospects. The file P02_20.xlsx contains the...
-
Find the local maximum and minimum values and saddle points of the function f(x, y) = x-3x + 3xy.
-
A boy is playing in a tree house in his fenced backyard and throws a ball. The ball\'s inital velocity is 9 . 5 m / s angled 3 2 degrees above the horizontal and released 2 . 4 m above the ground. If...
-
Blaser Inc. is a public company that trades on the Toronto stock exchange. It is a supplier of many of the most commonly used pharmaceuticals in Canada. In the last few years the company's growth has...
-
You have a $ 9 0 , 0 0 0 ten - stock portfolio with a beta of 1 . 2 5 . If you add $ 1 5 , 0 0 0 worth of Stock A ( beta = 1 . 3 8 ) to this portfolio, the resulting portfolio would have a beta of:...
-
ground? A pilot flying low and slow drops a weight; it takes 1.8 s to hit the ground, during which it travels a horizontal distance of 150 m. Now the pilot does a run at the same height but twice the...
-
Review the Case Study: MBA Schools in Asia-Pacific and the Case Study: MBA Schools in Asia-Pacific data set. Prepare a managerial report. What is the type of data (Quantitative or Qualitative) for...
-
AB CORPORATION ISSUED THE FOLLOWING 850 COMMON STOCKS PAR VALUE P100 750 PARTICIPATING PREFERRED STOCKS PAR VALUE P100 AT 3% AB CORPORATION DECLARED P100,000.00 DIVIDEND IN 2022.
-
Write a program that reads an integer between 0 and 1000 and adds all the digits in the integer. For example, if an integer is 932, the sum of all its digits is 14. Use the % operator to extract...
-
Write a program that prompts the user to enter the minutes (e.g., 1 billion), and displays the number of years and days for the minutes. For simplicity, assume a year has 365 days. Here is a sample...
-
Listing 2.7, ShowCurrentTime.java, gives a program that displays the current time in GMT. Revise the program so that it prompts the user to enter the time zone offset to GMT and displays the time in...
-
4. Enumerate the four (4) classifications of controls as to who performs. (4 points) 5. Give four (4) responsibilities of management on the internal control system. (4 points) 6. Give five (5) roles...
-
For the company you are analyzing, the company's compensation committee recommends awarding fewer stock options to executives in the future. The company adopts this recommendation, and this is...
-
77. For the company you are analyzing, the company's compensation committee recommends awarding fewer stock options to executives in the future. The company adopts this recommendation, and this is...
Study smarter with the SolutionInn App