• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem ideas  RSS feed

 
Johannes Thorén
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good evening.

I've been assigned to hold a lesson for a class at my old high school, I'm going to talk about lists
in Java, maybe a little bit about Java in general too. They also told me that I had to come up with a problem
involving lists for the students to solve until the next week.

I'm wondering if anyone got any good idea of a problem to give them, or if it's something that I really must talk
about or something that I shouldn't talk about?

The students have studied programming in Actionscript 2.0 once a week for 8 weeks and have just begun to study Java.

Kind regards, Johannes
 
Stephan van Hulst
Saloon Keeper
Posts: 7993
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do they know about Generics yet? If not, are you prepared to teach them? I would strongly discourage you from teaching them about 'raw' Lists.
 
Johannes Thorén
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They don't, I don't think I'm supposed to talk about it ether, I were going to talk about ArrayList, Vector, LinkedList
Random Access, try to make them understand when to use what. But since they just started with Java I don't want to
drown them in information. Therefore I'm looking for some funny problem to give them, that will teach them but still wont
get their curiosity for programming disappear
 
Stephan van Hulst
Saloon Keeper
Posts: 7993
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm, well you don't have to explain them all about Generics, but if they're going to use the different Collections in an assignment, I would at least make them familiar with the syntax of Generics.

Example: Start using stuff like List<Student> right away. You can explain that this means "A List of Students". For now that will be sufficient. They can learn about Raw types later, when they are familiar with the proper way of programming.

As for problems, you can think of tonnes of problems involving Lists. I already gave an example with the List of Students, maybe you can build on this and make some sort of assignment involving Subjects and Teachers or something?
 
Johannes Thorén
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My first idea was to make them do some class, lets say Employee and then 2 subclasses, but the real teacher told me that
that was way to complicated, and that their not going to learn inheritance or implementation for like 8 more weeks.
I'm thinking maybe I could do the classes, so they wont have to bother with it, and maybe the problem can be sorting a list,
or changing something. If I tell them to solve the problem using different list types then they will see that Array has a fixed size for example.
And a question for higher grades might me "If I am going to do this program, having lists to take care of this problem, what class would be the smartest one to use?"
 
Mohamed Sanaulla
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont know if directly jumping to Collections(Lists) would be helpful for the learners. But considering they are familiar with ActionScript- which I suppose is also an OO Language and has similar syntax like Java. So that way you could introduce how OOP can be done in Java, then tell them about the Generic syntax- like why is that <> used. May be not mentioning the term "Generics" would be fine. you should be introducing bit of Inheritance concepts here- To explain what all can be inserted in the List. And then you could continue with the examples.

Sorting a list- Using the sort() function? or Implementing the sorting algorithms? The latter would be better. Agree that getting too much in to Java would require lot of time to explain- So better would be to Keep It Short and Simple. While I was taking a few workshops for Java- I have seen people getting lost due to the volume of information being fed to them at the same time
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!