Help Please Urgent

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2008
Posts: 1,638
Reputation: BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold 
Solved Threads: 206
BestJewSinceJC BestJewSinceJC is offline Offline
Posting Virtuoso

Re: Help Please Urgent

 
1
  #11
Feb 19th, 2009
There are two obvious things you could do as far as how you're thinking about the section of the Seats.

Scenario 1:
Think of the section the seat is in as a property of the seat. (In other words, since the seat will always be in the same section, you could have a variable in the Seat class called section).

Scenario 2:
Think of the section the seat is in as a property of the Theater- not of the seat. In this case, your Theater class could have an array of seats for each section. This is what I would personally do, I think.
Last edited by BestJewSinceJC; Feb 19th, 2009 at 6:09 pm.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 29
Reputation: Superstar288 is an unknown quantity at this point 
Solved Threads: 0
Superstar288 Superstar288 is offline Offline
Light Poster

Re: Help Please Urgent

 
0
  #12
Feb 19th, 2009
lol thanks for that reply BestJewSinceJC is there any chance you can explain the second scenario please?? what i dont understand is where should i make the array of seats?? ahhhhhhh
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 1,638
Reputation: BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold 
Solved Threads: 206
BestJewSinceJC BestJewSinceJC is offline Offline
Posting Virtuoso

Re: Help Please Urgent

 
0
  #13
Feb 19th, 2009
Lets say you have three sections. Then you would have three arrays of seats, one for each section.

public class Theater{
-seat array here
-second seat array here
-third seat array here

}
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 823
Reputation: verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough 
Solved Threads: 73
verruckt24's Avatar
verruckt24 verruckt24 is offline Offline
Practically a Posting Shark

Re: Help Please Urgent

 
0
  #14
Feb 19th, 2009
@superstar288: You have been given enough hints on where and how to make the array of Seats, also on the attributes about the Seats etc. I suggest if you are still not able to figure this out then you go read some Java Tutorials on classes, array and how to make arrays within classes etc.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,508
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 522
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: Help Please Urgent

 
0
  #15
Feb 19th, 2009
A more generalized Theater class design would have either a single collection of seats with the section, price, etc being properties of the seats, or another intermediate collection class to represent seating sections that contained their own collections of seats.

Theaters do not all share common layouts or number of seats, so hard-coding in three arrays for seats ties your implementation to a theater that had three distinct sections of seats with different properties.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 1,638
Reputation: BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold 
Solved Threads: 206
BestJewSinceJC BestJewSinceJC is offline Offline
Posting Virtuoso

Re: Help Please Urgent

 
0
  #16
Feb 20th, 2009
I understand reusability and coupling (not sure if the OP does or doesn't) but if I was writing this, I'd probably feel that your suggestion is needlessly complex and doesn't offer enough benefit to justify the extra work. Maybe I'm wrong - I'd like to see a seating collection that actually offers some benefit
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,508
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 522
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: Help Please Urgent

 
0
  #17
Feb 20th, 2009
Putting in a SeatingSection class probably is more complex than the OP needs for this assignment. I just threw that in as a consideration to get them thinking a bit. I think all they really need is a single collection, List or array, of Seats.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC