Thread: Array Problems
View Single Post
Old Jan 31st, 2008, 2:23 PM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,798
Rep Power: 5 Sane will become famous soon enough
Re: Array Problems

When the printsummary is called you should do something along the lines of:

Psuedocode Syntax (Toggle Plain Text)
  1. orchestraSeats = 0
  2. orchestraMoney = 0
  3.  
  4. for each item in transactionclubSale
  5. if item.typeString is Orchestra
  6. orchestraSeats += 1
  7. orchestraMoney += item.priceDecimal
  8.  
  9. Output the orchestraSeats and orchestraMoney
  10.  
  11. Repeat for Mezzanine, General, etc...


There are more efficient ways of doing this, but that would be the easiest way with your level of programming experience.
Sane is offline   Reply With Quote