• Post Reply Bookmark Topic Watch Topic
  • New Topic

can I use an array?, how to create vertical lines?  RSS feed

 
Nancy Bradley
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an assignment where I should write an abstract class which will be the base to calculate some points of a competition. The points will be assigned different depending on weather the person is a boy,girl,man or woman.
I have 2 boys, 3 women,2 girls and 2 men. I just type the number of item each one collected, but I was wondering if there is a better way of doing it, maybe with an array for each group? Can I have it in the test class,or has to be in each individual class?
Also I am suppose to create a table how can I get the vertical lines?
Thank you in advance for your help
Nancy B

[ edited to break really long lines and to remove the evil tab character -ds ]
[ April 19, 2004: Message edited by: Dirk Schreckmann ]
 
Nigel Browne
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Also I am suppose to create a table how can I get the vertical lines?

Have a look at JTable in Thw Swing Tutorial

Think about think the above code the extends keyword denotes an "is a" relationship. I find it difficult to think of people as rewards. A man, boy, woman and girl are all types of Person. A Person would have a name, sex, age e.t.c
The implements keyword denotes a "has a" relationship, therefore a person could have a reward for completing a task. For me that means an interface for the reward system.
Keep asking questions and I'm sure you will find the answer here.
Regards
Nigel
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also I am suppose to create a table how can I get the vertical lines?
For console output, you could make use of the | character. And the + character might work well for places where a vertical line meets a horizontal line.
 
Nancy Bradley
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I got the table going.
Thanks a lot
Nancy B
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!