Subject Computer Science C-Family Programming


Shipping charges
The fast freight shipping charges the following rates
Weight of packages - Rate per pound
2 pounds or less - $1.10
Over 2 pound but not more than 6 pounds - $2.20
Over 6 pounds but not more than 10 pounds - $3.70
Over 10 pounds - $3.80
Design a program that asks the user to enter the weight of a package and then displays the shipping charges.
Use MS-Word to create a file to contain the text of your solution (in pseudocode form).
Save the file you created using MS-Word to your computer (or flash drive).
You need to set up a pseudocode solution that is complete and workable.
For your solution to be complete, you must:
• Prompt the user for the input data asked for within the problem statement
• Set up a correct formula to process the input data, arriving at the output data
• Provide the output data asked for within the problem statement to the user For your solution to be workable,
• There should not be any logic errors in your solution
• You may want to set up a hand trace chart, showing the values of your variables as you move through the solution from one statement to the next
• You do NOT need to turn in any hand trace chart
Instructions on documenting your solutions:
• Prior to the start of your solution, include a paragraph, explaining what is being accomplished.
• Within your solution, include the following 3 sections:
o Input Data: document variables used to hold input data
o Output Data: document variables used to hold output data
o Processing: document the formulas/equations you set up as part of your processing

Solution Preview

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

Assisting Tutor

Related Homework Solutions

Programming Problem: Calories & Money
Homework Solution
Computer Science
Dynamic Programming
File Management
C entsMemoized Implementation
Iterative Implementation
Get help from a qualified tutor
Live Chats