Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1.  
  2. package prelim_carpost;
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class Prelim_Carpost {
  7.  
  8. public static void main(String[] args, double rate, Double lto_fee) {
  9. String name;
  10. Double brand_car, m_yr, sel_price, lto_rf, compre_if, chattel_mf, d_rate,r,fee,fees, t_price;
  11.  
  12. Scanner x = new Scanner (System.in);
  13.  
  14. System.out.println("Customer's Name: ");
  15. name = x.nextLine();
  16. System.out.println("Brand of Car: ");
  17. brand_car = x.nextDouble();
  18. System.out.println("Model Year Model: ");
  19. m_yr = x.nextDouble();
  20. System.out.println("Selling Price: ");
  21. sel_price = x.nextDouble();
  22. System.out.println("LTO Registration Fee: ");
  23. lto_rf = x.nextDouble();
  24. System.out.println("Comprehensive Insurance Fee: ");
  25. compre_if = x.nextDouble();
  26. System.out.println("Chattel Mortgage Fees: ");
  27. chattel_mf = x.nextDouble();
  28.  
  29. if (m_yr == 2020 ) {
  30. d_rate = 0.00;
  31. }
  32. else if (m_yr == 2018 && m_yr ==2019 ){
  33. d_rate = 0.02;
  34. }
  35. else if (m_yr == 2016 && m_yr == 2017){
  36. d_rate= 0.05;
  37. }
  38. else if (m_yr == 2014 && m_yr <= 2018){
  39. d_rate = 0.07;
  40. }
  41. else {
  42. d_rate = 0.10;
  43. }
  44. rate = d_rate / 100;
  45.  
  46. fee = lto_fee + compre_if + chattel_mf;
  47. fees =fee+ (fee*0.12);
  48. t_price = fees * d_rate;
  49.  
  50. System.exit(0);
  51. }
  52.  
  53. } // TODO code application logic here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement