Advertisement
Guest User

C programming help

a guest
Jun 25th, 2012
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     double weight, miles, rate370;
  7.    
  8.     printf("How heavy is the package in pounds . \n");
  9.     scanf("%lf", &weight);
  10.     printf("The package weighs : %.2lf \n", weight);
  11.    
  12.     printf("How many miles are you shipping the package .\n");
  13.     scanf("%lf", &miles);
  14.     printf("You are shipping the package %.2lf \n", miles);
  15.    
  16.     if ( weight <= 5.6 )
  17.     {
  18.         rate370 = (int) miles / 500 * 3.7;
  19.         printf("Your total cost : %.2lf\n", rate370);
  20.        
  21.     }
  22.  
  23.    
  24.    
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement