Created
July 6, 2016 03:16
-
-
Save rightson/4c6ed636f1365b145fd0fcebc90716cc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public String htmlStatement() { | |
Enumeration rentals = _rentals.elements(); | |
String result = "<H1>Rentals for <EM>" + getName() + "</EM></H1><P>\n"; | |
while (rentals.hasMoreElements()) { | |
Rental each = (Rental) rentals.nextElement(); | |
//show figures for each rental | |
result += each.getMovie().getTitle()+ ": " + | |
String.valueOf(each.getCharge()) + "<BR>\n"; | |
} | |
//add footer lines | |
result += "<P>You owe <EM>" + String.valueOf(getTotalCharge()) + | |
"</EM><P>\n"; | |
result += "On this rental you earned <EM>" + | |
String.valueOf(getTotalFrequentRenterPoints()) + | |
"</EM> frequent renter points<P>"; | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment