Monty374

Customer

Nov 14th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. package bank;
  2.  
  3. /**
  4. * Customer class.
  5. */
  6.  
  7.  
  8. public class Customer {
  9. private String firstName, lastName, street, city, state, zip;
  10.  
  11.  
  12. /**
  13. * constructor
  14. * pre: none
  15. * post: A Customer object has been created.
  16. * Customer data has been initialized with parameters.
  17. */
  18. public Customer(String fName, String lName, String str, String c, String s, String z) {
  19. firstName = fName;
  20. lastName = lName;
  21. street = str;
  22. city = c;
  23. state = s;
  24. zip = z;
  25. }
  26.  
  27. public void changeStreet(String newStr) {
  28. street = newStr;
  29. }
  30.  
  31. public void changeCity(String newCty) {
  32. city = newCty;
  33. }
  34.  
  35. public void changeState(String newS) {
  36. state = newS;
  37. }
  38.  
  39. public void changeZIP(String newZIP) {
  40. zip = newZIP;
  41. }
  42.  
  43. /**
  44. * Returns a String that represents the Customer object.
  45. * pre: none
  46. * post: A string representing the Account object has
  47. * been returned.
  48. */
  49. public String toString() {
  50. String custString;
  51.  
  52. custString = firstName + " " + lastName + "\n";
  53. custString += street + "\n";
  54. custString += city + ", " + state + " " + zip + "\n";
  55. return(custString);
  56. }
  57. }
Add Comment
Please, Sign In to add comment