Create a program that will allow me to enter the weight of a
Solution
#include <stdio.h>
#include <stdlib.h>
int main( ) {
double w;//Weight of the item
int n;//Number of items
double weight;
int shipping;//Shipping costs
printf( \"Enter the weight of the item in lb:\");
scanf(\"%lf\", &w);
printf( \"Enter the number of items:\");
scanf(\"%d\", &n);
weight=w*n;//Calculate the weight of the package
if (weight<5)
{
shipping=5;
}
else if (weight>=5 && weight<=10)
{
shipping=7;
}
else if (weight>10)
{
shipping=10;
}
printf(\"The shipping cost is=%d dollars\ \",shipping);
return 0;
}
