Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Java INSURANCE Program

Newheregetdonehomework
Newheregetdonehomework 


Next week a last week for me and I have 3 Exam I do not have time to get this one done... so I need help I need this by 12/04/2015 11:59PM Friday on Virginia time Zone. EST now 35$ someone do it time is running out Attachments Tags Clarifications

Answers

Solution for Insurance and Distribution Program

ravi_singh
ravi_singh 



Hey There,
i have added solution for both programs
First part needs following files
1)Insurance.java
2)TrackInsurance.java
3)Customer.java
4)ArtInsurance.java
5)AutoInsurance.java
6)HealthInsurance.java
7)LifeInsurance.java
run TrackInsurance.java
start with option 8 i.e populating the data for customers and Insurance.

Second part needs following file
1)Distribution.java
2)input.txt
run Distribution.java make sure you have input.txt in your current working directory

I have attached the screenshot of sample run for Distribution program
as the sample run for Insurance program was large i have added that run in text file run.txt
Please check it out.
and please ask if you have any doubt.

IF YOU HAVE ANY DOUBTS PLEASE mail me at ravi.kmr.singh8[at]gmail.com
Attachments
ArtInsurance.java (1 K) Download Preview
if (valueArtWork >= 0) yearlyRate = valueArtWork * .19; } // we override the toString method from the Insurance class public String toString() { // add on the info for this class return super.toString() + (" for art insurance. The art work is \"" + artDescription + "\", and the

AutoInsurance.java (1 K) Download Preview
yearlyRate = 500 * numCars; } // we override the toString method from the Insurance class public String toString() { String ans = super.toString(); // print out the toString method from my super (ie the Insurance class) return ans + (" for auto insurance. The number of cars is "

Customer.java (2 K) Download Preview
the first name * @return a String that is the first name */ public String getFirst() { return first; } /** * used to get the id * @return a String that is the id */ public int getId() { return id; } /** * used to get the last

HealthInsurance.java (1 K) Download Preview
the body super(cust); numDependents = dependents; calcRate(); } // full constructor if read from a file public HealthInsurance(Customer cust, int polNum, double yrRate, int numD) { super(cust, polNum, yrRate); numDependents = numD; } // empty constructor public HealthInsurance() { } // required to make a complete class since we inherited

Insurance.java (2 K) Download Preview
Insurance implements Comparable<Insurance> ,Serializable{ // NOTE: these fields are protected!!!!! If I am to inherit // these , they must be protected (private allows NO other classes // to use them) - protected means this class and any class that inherits // from this one can use these protected Customer

LifeInsurance.java (1 K) Download Preview
yrRate, int amtIns, int custAge) { // you code this super(cust, polNum, yrRate); amount = amtIns; age = custAge; } // required to write this if this class is to be a real class - fulfills the abstract requirements public void calcRate() { if (age > 40) yearlyRate = amount

TrackInsurance.java (9 K) Download Preview
end while } public static int menu() { System.out.println("Choice:"); System.out.println(" 1. Print all customers (call the toString method)"); System.out.println(" 2. Print all insurance information (call the toString method)"); System.out.println(" 3. Given a policy number, print the policy information"); System.out.println(" 4. Find all of the policies for a given customer"); System.out.println("

input.txt (1 K) Download Preview
4 2 3 9 9

run.txt (9 K) Download Preview
= 200 Choice: 1. Print all customers (call the toString method) 2. Print all insurance information (call the toString method) 3. Given a policy number, print the policy information 4. Find all of the policies for a given customer 5. Sort the insurance policy

runIns.png (23 K) Download Preview

Distribution.java (1 K) Download Preview
Exception{ Scanner sc= new Scanner(new File("input.txt")); int[] num=new int[10]; double sum=0; int numValues=0; int value=0; while(sc.hasNext()){

dist.PNG (3 K) Download Preview

Screenshots
Screenshot
Screenshot
Purchase Answer