This repository has been archived by the owner on Jun 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resident portal - view apt details function works
- Loading branch information
Showing
4 changed files
with
147 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package numa.Portals; | ||
|
||
import java.sql.Timestamp; | ||
import java.util.ArrayList; | ||
|
||
public class Lease { | ||
int prop_id; | ||
String street_name; | ||
String apt; | ||
String city; | ||
String state; | ||
String zip; | ||
Timestamp start_date; | ||
int term_length; | ||
int rent_amount; | ||
|
||
public Lease(int prop_id, String street_name, String apt, String city, String state, String zip, Timestamp start_date, int term_length, int rent_amount) { | ||
this.prop_id = prop_id; | ||
this.street_name = street_name; | ||
this.apt = apt; | ||
this.city = city; | ||
this.state = state; | ||
this.zip = zip; | ||
this.start_date = start_date; | ||
this.term_length = term_length; | ||
this.rent_amount = rent_amount; | ||
} | ||
|
||
public String toString() { | ||
String outStr = String.format( | ||
"Address:\n" + | ||
"%s\n" + | ||
"Apt %s\n" + | ||
"%s, %s %s\n" + | ||
"Lease Start: %s\n" + | ||
"Lease Term Length: %d\n" + | ||
"Rent: $%d\n", | ||
street_name, apt, city, state, zip, start_date, term_length, rent_amount | ||
); | ||
return outStr; | ||
} | ||
|
||
public String toString(ArrayList<Amenity> amenities) { | ||
String outStr = this.toString(); | ||
outStr += "Amenities:\n"; | ||
for (Amenity prop: amenities) { | ||
outStr += prop.toString(); | ||
} | ||
return outStr; | ||
} | ||
} | ||
|
||
class Amenity { | ||
String amenity; | ||
int cost; | ||
|
||
public Amenity(String amenity, int cost) { | ||
this.amenity = amenity; | ||
this.cost = cost; | ||
} | ||
|
||
public String toString() { | ||
String outStr = String.format( | ||
" - %s: $%d\n", | ||
amenity, cost | ||
); | ||
return outStr; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters