Advertisement
Guest User

lel

a guest
Jan 17th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.80 KB | None | 0 0
  1. //sees which option the client has come from
  2. if (option == 1)
  3. {
  4. //checks to see if the system has previously rejected the policy
  5. if (!(String.valueOf (p).equals("-1")))
  6. {
  7. accepted++;
  8. quantity = quantity + q;
  9. //sees if the terms are anual
  10. if(t.equals("A"))
  11. {
  12. //if it is anual it adds the running total to it
  13. premium = premium + (p/12);
  14. }
  15. else
  16. {
  17. //if its not anual it adds the premium to it
  18. premium = premium + p;
  19. }
  20. }//end of if
  21. }//end of if option 1
  22.  
  23. else if (option == 2)
  24. {
  25. //sees if the date the client wants is in the month
  26. if (d.toLowerCase().contains(month))
  27. {
  28. monthTotal++;
  29. if (!(String.valueOf(p).equals("-1")))
  30. {
  31. accepted++;
  32. quantity = quantity + q;
  33. if (t.equals("A"))
  34. {
  35. premium = premium + (p/12);
  36. }//end of A if
  37. else
  38. {
  39. premium = premium + p;
  40. }//end of else
  41.  
  42. }//end of if equals
  43. }//end of if month
  44. }
  45.  
  46. else if (option == 3)
  47. {
  48. if (r.toLowerCase().contains(search) || n.toLowerCase().contains(search))
  49. {
  50.  
  51. }
  52.  
  53. }//end of else if option 2
  54.  
  55. //checks if a user came from a ccertain option
  56. if (option == 1)
  57. {
  58. if (d.contains ("Jan"))
  59. {
  60. jan++;
  61. }
  62. else if(d.contains ("Feb"))
  63. {
  64. feb++;
  65. }
  66. else if(d.contains ("Mar"))
  67. {
  68. mar++;
  69. }
  70. else if(d.contains ("Apr"))
  71. {
  72. apr++;
  73. }
  74. else if(d.contains ("May"))
  75. {
  76. may++;
  77. }
  78. else if(d.contains ("Jun"))
  79. {
  80. jun++;
  81. }
  82. else if(d.contains ("Jul"))
  83. {
  84. jul++;
  85. }
  86. else if(d.contains ("Aug"))
  87. {
  88. aug++;
  89. }
  90. else if(d.contains ("Sep"))
  91. {
  92. sep++;
  93. }
  94. else if(d.contains ("Oct"))
  95. {
  96. oct++;
  97. }
  98. else if(d.contains ("Nov"))
  99. {
  100. nov++;
  101. }
  102. else if(d.contains ("Dec"))
  103. {
  104. dec++;
  105. }
  106. }//end of while loop
  107. }//end of if option 1
  108.  
  109. if (option == 1 || option == 2)
  110. {
  111. //changes to premium to pounds and pence
  112. premium = (premium / accepted / 100);
  113. //outputs the summary box of the policy chosen
  114. System.out.println("Total number of policies: " + monthTotal);
  115. System.out.println("Number of items: " + quantity / accepted);
  116. System.out.println("Monthly premium: " + Math.round(premium*100/100));
  117.  
  118. //checks which option the client came from
  119. if (option == 1)
  120. {
  121. System.out.println("Number of policies per month including non accepted ones: ");
  122. System.out.println(" ");
  123. System.out.printf("%-4s %-4s %-4s %-4s %-4s %-4s %-4s %-4s %-4s %-4s %-4s %-4s","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
  124. System.out.println("");
  125. System.out.printf("%-4s %-4s %-4s %-4s %-4s %-4s %-4s %-4s %-4s %-4s %-4s %-4s",jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec);
  126. }
  127. }//end of if statement
  128. }//end of read from file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement