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
  • 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. 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...

  • 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. 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, i.e., 600 miles is the same rate as 900 miles or 1000 miles. Here are the shipping charges - Package Weight                                                                                Rate...

  • 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...

  • C programming only (Original work only as well, I will get into trouble if it is...

    C programming only (Original work only as well, I will get into trouble if it is a copy) also please add comments if it is not too much trouble. Program 5: Shipping Calculator The Speedy Shipping Company will ship packages based on how much they weigh and how far they are being sent. They will only ship small packages up to 10 pounds. You have been tasked with writing a program that will help Speedy Shipping determine how much to...

  • 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...

  • IN C++ PROGRAMMING (We use #include <iostream> and cout and cin) Shipping Calculator Speedy Shipping Company...

    IN C++ PROGRAMMING (We use #include <iostream> and cout and cin) 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 world. They will only ship small packages up to 10 pounds. You need to have a program, which will help you determine how much they will charge. The charges are based on each 500 miles shipped. The mileage should be in whole...

  • 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...

  • 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...

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