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

Java

adrianhmartinez
adrianhmartinez 


Instructions are in the word document, there are also instructions in the jar file. the jar file is from eclipse luna 8 Attachments Tags Clarifications

Answers

Assignment Java -Solution

mariobeka
mariobeka 



Below you will find the solution to your assignment. Everything was implemented following the requirements of the document. Attachments
Java-Solution.zip (7 K) Download
Preview
String des, double val) { super(cust); description = des; value = val; calcRate(); } // full constructor if read from a file public ArtInsurance(Customer cust, int polNum, double yrRate, String description, double value) { super(cust, polNum, yrRate); this.description = description;

Preview
a file public AutoInsurance (Customer cust, int polNum, double yrRate, int numC) { super(cust,polNum,yrRate); numCars = numC; } // we were required to write a complete calcRate method by the abstract method in the // Insurance class. Must have the exact

Preview
- Customer first name */ public Customer(String custLast, String custFirst) { last = custLast; first = custFirst; id = num; num++; } /** * empty constructor but still creates a unique id for them */ public Customer()

Preview
those fields // and add on the new fields for this class // we override the toString method from the Insurance class @Override public String toString() { return super.toString() + (" health insurance. The number of dependents is " + numDependents); }

Preview
// toString method. Note - we let the customer write themself out since they have their own toString method // a class should only write out their fields in the toString method public String toString() { return (customer.toString() + " with policy number " + policyNumber

Preview
LifeInsurance(Customer cust, int polNum, double yrRate, int amtIns, int custAge) { super(cust, polNum, yrRate); this.amount = amtIns; this.age = custAge; } // required to write this if this class is to be a real class - fulfills the abstract requirements public void calcRate()

Preview
// create some fake customers (used for testing the program) Customer c = new Customer("Duck", "Donald"); Customer c1 = new Customer("Mouse", "Minnie"); Customer c2 = new Customer("Mouse", "Mickey"); // add the customers to the array list cust.add(c2); cust.add(c1); cust.add(c);

Screenshots
Purchase Answer