Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume that the post office has the following flat pricing for shipping packages based on their weight (maximum package weight is limited to 40 pounds):

Assume that the post office has the following flat pricing for shipping packages based on their weight (maximum package weight is limited to 40 pounds): WEIGHT PRICE up 2 lbs. $5.00 from 3 12 lbs. $8.50 from 13 20 lbs. $12.50 from 21 40 lbs. $18.00 Write a C++ program that will input a series of package weights (one package weight per line) from the user and outputs the total number of packages in each weight category, and the total cost of all the packages to be shipped. Assume that the user has to input a 0 (zero) to complete the data entry. No source code comments are required. For example, if the user enters the following data: 2, 35, 12, 1, 17, 4, 0; the output should be as follows: 2 packages under 2 lbs. 2 packages between 3 12 lbs. 1 package between 13 20 lbs. 1 package between 21 40 lbs. The total shipping price is $57.50

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

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

7 Explain the equity theory of motivation.

Answered: 1 week ago

Question

Explain the causes of indiscipline.

Answered: 1 week ago