Assignment Three Hints

I've recieved some questions about assignment three, so here's some hints:

Bank Account

Getters and Setters are the functions which can get or set a property of an object (we store the properties of an object in the member variables). For example:
// The actual variable which holds the balance: 
// Note that it's private
private long balanceInCents = 0;
// The public routines to get and set the balance 
// (Do we really want a public setter???!)
public void setBalance( double amountInDollars) {
  //code here to set the balanceInCents property
}
public double getBalance() {
  double theBalance = balanceInCents / 100.0;
  return( theBalance);
}

Palindrome

In order to parse a phrase you should break the phrase up into words and put it back together (without the spaces and punctuation).
You control how to parse in the constructor of the parser (you feed it a string containing all the characters on which you want to break up the phrase).

The views and opinions expressed in this page are strictly those of the page author.
The contents of this page have not been reviewed or approved by the University of Minnesota.