Answer:
C++ code for the problem given below
Step-by-step explanation:
#include<iostream>
#include <conio.h>
using namespace std;
void main()
{
double weight;
cout<<"Enter the weight of the package ";
cin>>weight;
if(weight>0 && weight<1)
cout<<"The shipping cost is $"<< 3.5*weight ;
else if(weight>1 && weight<3)
cout<<"The shipping cost is $"<<5.5*weight;
else if(weight<10 && weight>3)
cout<<"The shipping cost is $"<<8.5*weight;
else if(weight<20 && weight>10)
cout<<"The shipping cost is $"<<10.5*weight;
else if(weight< 0)
cout<<"Enter a valid weight as the weight cannot be negative";
else if(weight >20)
cout<<"The package cannot be shipped;
getch();
}