Advertisement
Guest User

model

a guest
Dec 10th, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 1.18 KB | None | 0 0
  1. import java.util.ArrayList;
  2. import java.util.Scanner;
  3.  
  4. public class AccountData {
  5.  
  6.     ArrayList<AccountData> accountList = new ArrayList<AccountData>();
  7.     Scanner myScan = new Scanner(System.in);
  8.  
  9.     // variables
  10.     String firstName;
  11.     String lastName;
  12.     String address;
  13.     int pin = 0;
  14.     int balance = 0;
  15.  
  16.     public AccountData() {
  17.  
  18.     }
  19.  
  20.     // set
  21.  
  22.     public void setFirstName(String first) {
  23.         firstName = first;
  24.     }
  25.  
  26.     public void setLastName(String last) {
  27.         lastName = last;
  28.     }
  29.  
  30.     public void setAddress(String addr) {
  31.         address = addr;
  32.     }
  33.  
  34.     // this should eventually be changed to a PIN generator
  35.     public void setPin(int pin) {
  36.  
  37.         System.out.println("Desired PIN");
  38.         pin = myScan.nextInt();
  39.  
  40.     }
  41.  
  42.     // get
  43.  
  44.     public void getFirstName() {
  45.  
  46.         System.out.println("First name: " + firstName);
  47.  
  48.     }
  49.  
  50.     public void getLastName() {
  51.         System.out.println("Last name: " + lastName);
  52.     }
  53.  
  54.     public void getAddress() {
  55.         System.out.println("Address: " + address);
  56.     }
  57.  
  58.     public void getArrayList() {
  59.         System.out.println(accountList);
  60.     }
  61.  
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement