Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.text.NumberFormat;
  3.  
  4. public class HomeworkLabfour {
  5.  
  6. /**
  7. * @param args the command line arguments
  8. */
  9. public static void main(String[] args) {
  10.  
  11. NumberFormat fmt = NumberFormat.getCurrencyInstance();
  12. double rate1, rate2;
  13.  
  14. rate1 = .25;
  15. rate2 = .15;
  16.  
  17. Scanner in = new Scanner(System.in);
  18.  
  19. System.out.println("Enter Miles");
  20. int miles = in.nextInt();
  21.  
  22. if(miles <= 100)
  23.  
  24. System.out.println("The Amount owed= $" + (rate1 * miles));
  25.  
  26. else{
  27. System.out.println("The Amount owed= $" + (miles * rate1) + (miles * rate2));
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement