programming java assignment
Assignment2/Assignment-2-provided-code.zip Assignment-2/.classpath Assignment-2/.project Assignment-2/.settings/org.eclipse.jdt.core.prefs Assignment-2/src/assignment2/Landlord.javapackage assignment2; import java.util.*; // The Landlord class allows you to create objects that encapsulate the key data // about each Landlord, as well as the information about all the properties that // they make available for rent (some of which may have current leases active). public class Landlord { private String fullName; // The name of the landlord private String address; // Where the landlord lives! private String phone; // allow for spaces in number private long bankAccount; // To permit 10 digits, requires the 'long' data type private ArrayList myProperties; // All properties owned by this landlord public Landlord(String fullName, String address, String phone, long bankAccount) { // Simply store the parameters into the fields... this.fullName = fullName; this.address = address; this.phone = phone; this.bankAccount = bankAccount; // prepare for future leases... myProperties = new ArrayList(); } // ACCESSORS for each field of basic information public String getFullName() { return fullName; } public String getAddress() { return address; } public String getPhone() { return phone; } public long getBankAccount() { return bankAccount; } // Method to note/store another Property, where this Landlord is considered the owner of the property. // It returns true if successfully added to the list of properties belonging to this landlord. public boolean addProperty(Property theProperty) { boolean result; if (theProperty == null) // if it is null, we ignore this method call. result = false; else if (!myProperties.contains(theProperty)){ // Make sure it is not already in the array...
10 years ago
Purchase the answer to view it
- programming_java_assignment_1.docx
- programming_java_assignment_2.txt
- programming_java_assignment_3.txt
- programming_java_assignment_4.txt
- programming_java_assignment_5.txt
- programming_java_assignment_6.txt
- programming_java_assignment_7.txt
- programming_java_assignment_8.txt
- programming_java_assignment_9.txt
- programming_java_assignment_10.txt
- programming_java_assignment_11.txt
- programming_java_assignment_12.txt
- programming_java_assignment_13.txt