JAVA hwk help

profilerosasznwysui
TicketSystem.java

import java.util.Scanner; /** * Concert TicketSystem will allow users to buy tickets to a concert * * @author Instructors(Kendra Walther, Trina Gregory) and ----- your name ------ * @version ITP 109, Fall 2017 */ public class TicketSystem { // instance variables private Scanner input; // Used to get input from the user private ConsoleMenu menu; // Used to display a menu and get input from the user private String concertName; // Name of the concert the user is buying tickets for private String venueName; //Name of the venue for the concert private final int TOTAL_ROWS; //total number of rows in the venue (set in the constructor) private final int VIP_ROWS; // number of VIP rows in the venue (set in the constructor) private int vipSeatsSold; // Needs to increase when the user buys VIP tickets private int generalSeatsSold; // Needs to increase when the user buys General Floor tickets // Constants private static final String MENU_OPTIONS = "1: Print Seat Map\n2: Buy General Floor Tickets\n" + "3: Buy VIP Tickets\n4: Exit"; private static final int MENU_NUM_OPTIONS = 4; private static final int SEATS_PER_ROW = 10; /** * Constructor for class TicketSystem * Sets up the instance variables for a concert's ticket system. * * @param concert A parameter, a String holding the name of the concert * @param venue A parameter, a String holding the name of the concert's venue * @param totalRows A parameter, an int holding the total number of rows in the venue * @param vipRows A parameter, an int that says how many of the totwl rows are VIP rows. */ public TicketSystem(String concert, String venue, int totalRows, int vipRows) { input = new Scanner (System.in); menu = new ConsoleMenu(MENU_OPTIONS, MENU_NUM_OPTIONS); vipSeatsSold = 0; generalSeatsSold = 0; //Set up instance variables based on the input to the constructor concertName = concert; venueName = venue; TOTAL_ROWS = totalRows; VIP_ROWS = vipRows; } /** * Constructor for class TicketSystem * Sets up a concert's ticket system, with default values for total rows and vip * rows (total rows is 15 and vip rows is 2) * * @param concert A parameter, a String holding the name of the concert * @param venue A parameter, a String holding the name of the concert's venue */ public TicketSystem(String concert, String venue) { //TODO, use this TOTAL_ROWS = 15; VIP_ROWS = 3; //delete this once you provide the correct constructor call } /** * Default Constructor for class TicketSystem * Sets up the instance variables to predefined default values * The "default" concert is the "The Killers" * The "default" venue is "Staples Center" * Uses the same row defaults as the 2 parameter version of the constructor (15 and 3) */ public TicketSystem() { //TO DO, use this TOTAL_ROWS = 15; VIP_ROWS = 3; //delete this once you provide the correct constructor call } public void run () { //TODO: fill in code } private void printSeats () { //TODO: fill in code System.out.println ("There are " + vipSeatsAvailable() + " VIP seats available."); System.out.println ("There are " + generalSeatsAvailable() + " General Floor seats available."); } private int vipSeatsAvailable () { int seats = 0; //TODO: fill in code return seats; } private int generalSeatsAvailable () { int seats = 0; //TODO: fill in code return seats; } private void buyVipTickets () { //TODO: fill in code } private void buyGeneralTickets () { //TODO: fill in code } private void printDashes (int num) { //TODO: fill in code } private void printTicket (boolean isVip, int ticketsPurchased) { //TODO: fill in code } }