Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double packageWeight;
- double rate;
- System.out.println("Enter the weight of a package (in pounds)");
- packageWeight = scanner.nextDouble();
- if (packageWeight >= 10)
- {
- rate = 3.80;
- System.out.println("Shipping charge: " + rate + "$");
- }
- else if (packageWeight >= 6 && packageWeight < 10)
- {
- rate = 3.70;
- System.out.println("Shipping charge: " + rate + "$");
- }
- else if (packageWeight >= 2 && packageWeight < 6)
- {
- rate = 2.20;
- System.out.println("Shipping charge: " + rate + "$");
- }
- else
- {
- rate = 1.10;
- System.out.println("Shipping charge: " + rate + "$");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement