Skip to content

Commit

Permalink
Replace temp with query
Browse files Browse the repository at this point in the history
  • Loading branch information
moloch committed Apr 11, 2014
1 parent a283e66 commit 0f3ed86
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/refactoring/Customer.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ public String statement() {
Enumeration rentals = _rentals.elements();
String result = "Rental Record for " + getName() + "\n";
while (rentals.hasMoreElements()) {
double thisAmount = 0;
Rental each = (Rental) rentals.nextElement();
thisAmount = each.getCharge();
// add frequent renter points
frequentRenterPoints++;
// add bonus for a two day new release rental
Expand All @@ -36,8 +34,8 @@ public String statement() {
frequentRenterPoints++;
// show figures for this rental
result += "\t" + each.getMovie().getTitle() + "\t"
+ String.valueOf(thisAmount) + "\n";
totalAmount += thisAmount;
+ String.valueOf(each.getCharge()) + "\n";
totalAmount += each.getCharge();
}
// add footer lines
result += "Amount owed is " + String.valueOf(totalAmount) + "\n";
Expand Down

0 comments on commit 0f3ed86

Please sign in to comment.