• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

accesing elements in a matrix  RSS feed

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys i am coding this Sales program.
The program asks the user for the sales of two weeks.
I want to access the elements of the matrix, so i can make comparations; for example: which sale is the highest sale,etc.
how can i solve this?
thanks for any response

this is the code:
create the matrix

loads the matrix


prints the matrix


[ June 03, 2006: Message edited by: Jack Bolton ]

[ June 03, 2006: Message edited by: Jack Bolton ]
[ June 03, 2006: Message edited by: Jack Bolton ]
 
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Jack Bolton:
...I want to access the elements of the matrix, so i can make comparations; for example: which sale is the highest sale,etc. how can i solve this? ...


I'm not sure I understand the question. In your code to print the matrix, you are accessing the elements.

Your code works fine, but I couldn't resist a little clean-up...
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont understand what you mean, but if you want to find out the highest elements of the matrix you can:



If you wanted to compare to elements, same day from opposite week for example.

 
Jack Bolton
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!