Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(JAVA) Assume a customer is shipping one or more packages. Your program prompts the user for two float values: the weight of a package in

(JAVA) Assume a customer is shipping one or more packages. Your program prompts the user for two float values: the weight of a package in pounds, a shipping price per pound and calculates the cost to ship the package(s). Your program should print dollars and cents with two decimal places such as $32.85, and not $32.8467777. After completing the calculation for the first package ask the user if there are additional packages, allow the user continue the loop of calculations as many times as desired.

Hint: You can use the format or printf methods we discussed in class. You get extra credit if you dare to round your floating point value x to the nearest hundredth, by adding .005, multiplying by 100, casting to an integer, casting back to a float, and dividing by 100.

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions