This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
The program shipping.cpp performs the calculation of the shipping charge function of the weight of the package.
Input data: the variable weight holds the value for the weight of the package (provided by user’s input). The four rates (rate_1, rate_2, rate_3 and rate_4) hold the provided values for the charge per pound function of the package weight. They were declared as constants to allow easier manipulation of the program (if they are changed it is necessary to edit the program in one place only – in the declaration section).
Output data: the variable shipping_charge holds the result of the calculation for the shipping charge corresponding to the entered package weight.
Processing: the calculation of the shipping charge is done using the formula:
shipping_charge= weight * shipping_rate where
shipping_rate can have any of the following four (provided) values: $1.1, $2.2, $3.7 and $3.8....
This is only a preview of the solution. Please use the purchase button to see the entire solution