Question

Global Courier Services will ship your package based on how much it weighs and how far...

Global Courier Services will ship your package based
on how much it weighs and how far you are sending the package. (visual studio or dev c)

You need to write a design tool and a program in C that calculates
the shipping charge based on weight and distance and the total cost.

The shipping rates are as follows:

BASED ON WEIGHT

Charge 10 dollars for all package weighing 10 pounds or less

Charge an additional 2 dollars per pound for each pound
above 10 (make sure you charge the first 10 dollars)

For example if the weight is 2 pounds then the cost based on
weight is 10 dollars

For example if the weight is 55 pounds then the cost based
on weight is 10 for the first 10 pounds and 80 dollars for
the extra weight.

BASED ON DISTANCE
Charge 5 dollars for each 500 miles or part thereof.

For example if the distance is 1 foot then the cost based
on distance is 5 dollars.

For example if the distance is 1300 miles then the cost
based on distance is 15 dollars (3 500 segments) based on
per 500 miles shipped.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer: Hi!! Kindly find your solution below. Let me know if any issue. Thanks.

This program is designed in C language. Calculations is made based on your given statements in questions. The program is working well. It is taking necessary inputs and output as well. Calculations may differ. Some statements were confusing. If you want any changes please feel free to ask me. I'll modify this program.

#include<stdio.h>
int main()
{

//variable declarations
int weight,distance,q;
double cost_weight,cost_distance,total_cost;

printf("**Welcome to Global Courier Service**");
printf("\nEnter package weight in pounds:");
scanf("%d",&weight); //takes input weight of package
if(weight<=10) //check weight to determine cost
{
cost_weight = 10;
}
else
if(weight>10)
{
weight = weight-10;
cost_weight = 10;
cost_weight = cost_weight+weight*12+80; //additional charges
}
printf("\nEnter distance :");
scanf("%d",&distance); //takes input distance

//calculate cost based on distance

int r = distance % 500;
q = distance/500;

if(r==0)
{
cost_distance = q*5;
}
else
{
q=q+1;
cost_distance = q*5;
}

//print costs

printf("\nCost based on weight is: $%.2f",cost_weight);

printf("\nCost based on distance is: $%.2f",cost_distance);
printf("\nTotal cost is: $%.2f",cost_weight+cost_distance);
return 0;
}


Enter package weight in pounds:55 Enter distance :1300 Cost based on weight is: $630.00 Cost based on distance is: $15.00 Tot

Add a comment
Know the answer?
Add Answer to:
Global Courier Services will ship your package based on how much it weighs and how far...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PSLAYER 09/27/2017 yo October 9,2017 Graduation st Monday at T2:43 AM Shipping Calculator: Global Courier Services...

    PSLAYER 09/27/2017 yo October 9,2017 Graduation st Monday at T2:43 AM Shipping Calculator: Global Courier Services will ship your package based on how much it weighs and how far you are sending the package. Packages above 50 pounds will not be shipped. You need to write a program in C that calculates the shipping charge The shipping rates are based on per 500 miles shipped. They are not pro-rated, ie, 600 miles is the same rate as 900 miles or...

  • In this assignment, you will develop a C++ program which calculates a shipping charge and determines...

    In this assignment, you will develop a C++ program which calculates a shipping charge and determines the “type of trip” for a freight shipping company. Ask the user to enter the distance a package is to be shipped, and use a menu and a switch statement to determine the rate based on the package’s weight. Then display the shipping charge and using the table in #7 below, display the type of trip. Below is the chart to use to calculate...

  • C PROGRAMMING Introduction In this part, you will solve a problem described in English. Although you...

    C PROGRAMMING Introduction In this part, you will solve a problem described in English. Although you may discuss ideas with your classmates, etc., everyone must write and submit their own version of the program. Do NOT use anyone else’s code, as this will result in a zero for you and the other person! Shipping Calculator Speedy Shipping Company will ship your package based on the weight and how far you are sending the package, which can be anywhere in the...

  • AVE29.1: Using constants in expressions ACTIVITY The cost to ship a package is a flat fee...

    AVE29.1: Using constants in expressions ACTIVITY The cost to ship a package is a flat fee of 75 cents plus 25 cents per pound. 1. Declare a const named CENTS_PER_POUND and initialize with 25. 2. Get the shipping weight from user input storing the weight into shipWeightPounds. 3. Using FLAT FEE CENTS and CENTS PER POUND constants, assign shipCostCents with the cost of shipping a package weighing shipWeightPounds. 1 #include <stdio.h> 3 int main(void) f 5 int shipCostcents e; 165...

  • C++ Lone Star Package Service ships packages within the state of Texas. Packages are accepted for...

    C++ Lone Star Package Service ships packages within the state of Texas. Packages are accepted for shipping subject to the following restrictions: Shipping requirements The package weight must not exceed 50 pounds. The package must not exceed 3 feet in length, width, or height. The girth of the package must not exceed 5 feet. The girth is the circumference around the two smallest sides of the package. If side1, side2, and side3 are the lengths of the three sides, and...

  • please Answer c (Cost of Shipment) Although a regional express delivery service bases the charge for shipping a package on the package weight and distance shipped, its profit per package depends...

    please Answer c (Cost of Shipment) Although a regional express delivery service bases the charge for shipping a package on the package weight and distance shipped, its profit per package depends on the package size (volume of space that it occupies) and the size and nature of the load on the delivery truck. The company recently conducted a study to investigate the relationship between the cost, y, of shipment (in dollars) and the variables that control the shipping charge- package...

  • My program works fine with if else conditions but when it is not working when I...

    My program works fine with if else conditions but when it is not working when I try to implement it using a for loop. Can you fix my for loop and please show me how to do this using loops? I would appreciate if you could explain the loop that you are using. /* Programming Challenge: Shipping Charges The Fast Freight Shipping Company charges the following rates: Weight of Package (in Kilograms) Rate per 500 Miles Shipped 2 kg or...

  • ***USING JAVA. MUST USE A SWITCH STATEMENT. THANK YOU. Fall 2019 - Homework #3: Shipping Rates...

    ***USING JAVA. MUST USE A SWITCH STATEMENT. THANK YOU. Fall 2019 - Homework #3: Shipping Rates A client has hired your firm to implement their shipping rate rules as a Java program they can easily run. They have provided the following business rules to you. For each category, a cost and shipping time is added, as noted: Box Volume Categories: Category 1: 0.0 to 0.5 cubic feet, adds $5 to cost. Category 2: 0.5 to 2.0 cubic feet, adds $10...

  • Intro to C++ For this program, again use Program 4-18 in the text as an example....

    Intro to C++ For this program, again use Program 4-18 in the text as an example. Assume you're writing this menu-driven program for a shipping company. There are two types of shipments: normal and expedited. a. As shown in Program 4-18, please declare constants for the types of shipments. Please write the names of constants in ALL CAPS. b. Show the menu in a clear form, and prompt the user for the type of shipment; the rest of the program...

  • please post ONLY flatratepackage.cpp, flateratepackage.h, package inventory.h and package inventory.cpp... Thank you! In this homework, you...

    please post ONLY flatratepackage.cpp, flateratepackage.h, package inventory.h and package inventory.cpp... Thank you! In this homework, you are going to write a program to represent various types of packages offered by package-delivery services. You need to create an inheritance hierarchy to represent various types of packages with different shipping options and associated costs. The base class is Package and the derived classes are FlatRatePackage and OvernightPackage. The base class Package includes the following attributes: • Sender information: senderName (string), senderAddress (string),...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT