Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bank;
- /**
- * Customer class.
- */
- public class Customer {
- private String firstName, lastName, street, city, state, zip;
- /**
- * constructor
- * pre: none
- * post: A Customer object has been created.
- * Customer data has been initialized with parameters.
- */
- public Customer(String fName, String lName, String str, String c, String s, String z) {
- firstName = fName;
- lastName = lName;
- street = str;
- city = c;
- state = s;
- zip = z;
- }
- public void changeStreet(String newStr) {
- street = newStr;
- }
- public void changeCity(String newCty) {
- city = newCty;
- }
- public void changeState(String newS) {
- state = newS;
- }
- public void changeZIP(String newZIP) {
- zip = newZIP;
- }
- /**
- * Returns a String that represents the Customer object.
- * pre: none
- * post: A string representing the Account object has
- * been returned.
- */
- public String toString() {
- String custString;
- custString = firstName + " " + lastName + "\n";
- custString += street + "\n";
- custString += city + ", " + state + " " + zip + "\n";
- return(custString);
- }
- }
Add Comment
Please, Sign In to add comment