All pastes #824387 Raw Edit

Christian H

public text v1 · immutable
·published 2007-12-19 22:54 UTC
rendered paste body
public class Concert_Server {
	protected static int rows = 15;
	protected static Concert_Server[][]seats=new Concert_Server[rows][];
	protected String name, payment;
	protected int phone;
	
	public Concert_Server(){
		name="none;";
		payment="none";
		phone=123456;
	}
	
	public Concert_Server(String n , String pay, int ph){
		name=n;
		payment=pay;
		phone=ph;
	}
	
	public String getName(){
		return name;
	}
	
	public static void newArray(){
		int count=8;
		for(int x=0;x<rows;x++)
		{
			seats[x]=new Concert_Server[count];			
			for(int y=0;y<count;y++)
			{
				seats[x][y]=new Concert_Server();
			}
			count+=2;
		}
	}
	
	public static void printMenu()
	{
		int count = 8;
		for(int x=0; x<rows;x++){
	          for(int y=rows-x;y>0;y--)
	          {
	              System.out.print("\t");

	          }
	          for(int z=0;z<count;z++)
	          {
	        	  if((seats[x][z].getName()).equals("none")){
	        		  if(z==(count/2))
	        			  System.out.print("\tx  ");
	        		  else
	        			  System.out.print("x  ");
	        	  }
	        	  else{
	        		  if(z==(count/2))
	        			  System.out.print("\to  ");
	        		  else
	        			  System.out.print("o  ");
	        	  }
	          }
	          count+=2;
	          System.out.print("\n");
		}
		System.out.println("Your Choices:");
		System.out.println("Press 1 to enter seats manually");
		System.out.println("Press 2 to auto-select seats, up to 6");
		System.out.println("Press 3 to seaarch by name or seat assignment");
		System.out.println("Press 4 to reset the chart, requires admin rights.");
		
	}
}