





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






Instructions
code. Be sure that you have all of these items and that they are all legible.
It is always worth your time to plan ahead!
enough to express the each bullet item.
answers to each part.
in brackets immediately after the problem number. You may wish to use these point values as you budget your time across the exam period.
where possible, so show all of your work.
tem. The current version is given at the end of the exam.
Automated Acceptance Tests" article by Emery.
a match between the speciī cation for a system and the code that implements the system.
Fowlerās distinction between predictive versus adaptive approaches to software de- velopment processes.
questions about the software life cycle.
import java.util.Enumeration; import java.util.Vector;
public class Customer { private String name; private Vector rentals;
public Customer( String name ) { this.name = name; this.rentals = new Vector(); }
public void addRental( Rental arg ) { rentals.addElement( arg ); }
public String getName() { return name; }
public String statement() { double totalCharge = 0; int frequentRenterPoints = 0; String result = "Rental Record for " + getName() + "\n";
Enumeration entries = rentals.elements(); while ( entries.hasMoreElements() ) { Rental each = (Rental) entries.nextElement(); double rentalCharge = each.charge(); frequentRenterPoints += each.frequentRenterPoints();
// show figures for this rental result += "\t" + each.getMovie().getTitle() + "\t" + String.valueOf(rentalCharge) + "\n"; totalCharge += rentalCharge; }
result += "Amount owed is " + String.valueOf(totalCharge) + "\n"; result += "You earned " + String.valueOf(frequentRenterPoints) + " frequent renter points";
return result; }