package class10_2_SecurityMrFixRevisited_start;// Dr. Yoder. MSOE. 06 December 2016 import java.security.spec.ECField; import java.util.ArrayList; import java.util.List; /** * A class representing a person */ public class Person { public static final Salary DEFAULT_SALARY = new Salary(500,20); private String name; private List tickets = new ArrayList<>(); private Wallet wallet = new Wallet(10000); private Salary salary = DEFAULT_SALARY; /** * Create a new object representing the named person * @param name the person's name */ public Person(String name) { this.name = name; } public String getName() { return name; } public void addTicket(Ticket ticket) { tickets.add(ticket); } public List getTickets() { return tickets; } public void paySalary() { wallet.addPennies( salary.getDollars()*100+ salary.getCents()); } public void giveRaise() { salary = salary.createRaisedSalary(); } public Wallet getWallet() { return wallet; } /** * @return a description of the person */ public String toString() { String result = "A person named "+name+" with these tickets:\n"; for(Ticket ticket: tickets) { result += " "+ticket+"\n"; } result += "and "+wallet+"\n\n"; return result; } }