Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ch78test;
- import java.util.Scanner;
- public class Ch78Test
- {
- static double total=0, delivery=0, finalTotal=0;
- public static void delivery()
- {
- if(total<1000)delivery=25;
- if(total>=1000&&finalTotal<5000)delivery=65;
- if(total>=5000)delivery=85;
- }
- public static void main(String[] args)
- {
- Scanner sc=new Scanner(System.in);
- System.out.println("Enter order amount: $");
- double order=sc.nextDouble();
- calcTax calcTax=new calcTax(order);
- System.out.println("Total After Tax: ");
- calcTax.taxRate();
- Ch78Test.total=(double)calcTax.total;
- System.out.printf("%.2f",total);
- delivery();
- finalTotal=total+delivery;
- System.out.print("\nTotal After Delivery Fee: $");
- System.out.printf("%.2f",finalTotal);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement