I just started a very basic programming class and I'm trying to figure out how to calculate the cost of shipping a package based on miles and weight. I can enter the weight and miles but then cost comes out to 0.00 every time. Not sure where I'm going wrong. Also I am not doing Loops yet.
#include <stdio.h>
#include <stdlib.h>
main(){
double Weight, Miles, Cost;
printf("Enter your Package Weight: \n");
scanf("%lf", &Weight);
printf("Enter Miles traveled: \n");
scanf("%lf", &Miles);
if (Weight <= 2)
Cost = (Miles/500) * 1.5;
if (Weight <= 6)
Cost = (Miles/500) * 3.7;
if (Weight <= 10)
Cost = (Miles/500) * 5.25;
else
printf(" Your package is overweight limit!, \n");