/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package summer2014; /** * * @author jcmt */ public class Concert { private int day; private int month; private int year; private Performer performer; private float ticketPrice; public Concert() { this.setDay(1); this.setMonth(1); this.setYear(2015); this.performer = new Performer(0.0f,"Liberace"); this.setTicketPrice(0.0f); } public Concert(int day, int month, int year, String performer, float ticketPrice) { this.setDay(day); this.setMonth(month); this.setYear(year); this.performer = new Performer(ticketPrice, performer); this.setTicketPrice(ticketPrice); } public boolean setDay(int day) { if ((day > 0) && (day < 32)) { this.day = day; return true; } this.day = 1; return false; } public int getDay() { return day; } public int getMonth() { return month; } public void setMonth(int month) { if ((month < 1) || (month > 12)) { this.month = 1; return; } this.month = month; return; } public int getYear() { return year; } public void setYear(int year) { this.year = year; } public boolean setTicketPrice(float tP) { // we could error check for many things // number of decimal places // negative value if (tP < 0) //error case { ticketPrice = 0.0f; return false; } else { ticketPrice = tP; return true; } } public float getTicketPrice() { return ticketPrice; } public void setPerformer(Performer performer) { this.performer = performer; } public Performer getPerformer() { return performer; } }