Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //sees which option the client has come from
- if (option == 1)
- {
- //checks to see if the system has previously rejected the policy
- if (!(String.valueOf (p).equals("-1")))
- {
- accepted++;
- quantity = quantity + q;
- //sees if the terms are anual
- if(t.equals("A"))
- {
- //if it is anual it adds the running total to it
- premium = premium + (p/12);
- }
- else
- {
- //if its not anual it adds the premium to it
- premium = premium + p;
- }
- }//end of if
- }//end of if option 1
- else if (option == 2)
- {
- //sees if the date the client wants is in the month
- if (d.toLowerCase().contains(month))
- {
- monthTotal++;
- if (!(String.valueOf(p).equals("-1")))
- {
- accepted++;
- quantity = quantity + q;
- if (t.equals("A"))
- {
- premium = premium + (p/12);
- }//end of A if
- else
- {
- premium = premium + p;
- }//end of else
- }//end of if equals
- }//end of if month
- }
- else if (option == 3)
- {
- if (r.toLowerCase().contains(search) || n.toLowerCase().contains(search))
- {
- }
- }//end of else if option 2
- //checks if a user came from a ccertain option
- if (option == 1)
- {
- if (d.contains ("Jan"))
- {
- jan++;
- }
- else if(d.contains ("Feb"))
- {
- feb++;
- }
- else if(d.contains ("Mar"))
- {
- mar++;
- }
- else if(d.contains ("Apr"))
- {
- apr++;
- }
- else if(d.contains ("May"))
- {
- may++;
- }
- else if(d.contains ("Jun"))
- {
- jun++;
- }
- else if(d.contains ("Jul"))
- {
- jul++;
- }
- else if(d.contains ("Aug"))
- {
- aug++;
- }
- else if(d.contains ("Sep"))
- {
- sep++;
- }
- else if(d.contains ("Oct"))
- {
- oct++;
- }
- else if(d.contains ("Nov"))
- {
- nov++;
- }
- else if(d.contains ("Dec"))
- {
- dec++;
- }
- }//end of while loop
- }//end of if option 1
- if (option == 1 || option == 2)
- {
- //changes to premium to pounds and pence
- premium = (premium / accepted / 100);
- //outputs the summary box of the policy chosen
- System.out.println("Total number of policies: " + monthTotal);
- System.out.println("Number of items: " + quantity / accepted);
- System.out.println("Monthly premium: " + Math.round(premium*100/100));
- //checks which option the client came from
- if (option == 1)
- {
- System.out.println("Number of policies per month including non accepted ones: ");
- System.out.println(" ");
- 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");
- System.out.println("");
- 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);
- }
- }//end of if statement
- }//end of read from file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement