r/javahelp • • Apr 10 '14

Learning java and having trouble, is my teacher bad or am I just not getting it?

I normally have no problem teaching myself things with the internet, I've had to teach myself quite a bit of stuff during my "intro to programming" class that I'm taking.

I'm starting to run into problems where I don't know if it's me not understanding things or if the teacher is so bad at explaining them that I'm having trouble following. I get the feeling it's because he's trying to dumb it down to a point that people understand it better and don't drop the class. He didn't teach us how to make a graphics window appear before we started learning how to draw the pictures on the screen.

A lot of the homework is taught in "snippets." As in "write the snippet of code that does this." But I'm not learning how to apply it in a java source code.

I've been getting 100's on everything thus far, but this homework has me stumped, and I don't know if it's his formatting in his lecture notes, or if it's because when he lectures in class, he just kinda skims through his slides because he's been using the same ones for years.

This is a link to the homework I'm currently working on: http://walshe.faculty.mjc.edu/Virtual/IntroToProgramming/homework/homework12/homework12.html

I'd like if someone could take a look at it, specifically questions 1-8, using his "UML-Like" diagram and tell me if you can make heads or tails of it.

These are the answers I have so far.

  1. MultiplyTwoNumbers myObject = new MultiplyTwoNumbers(1,2);

  2. System.out.println(number1);

  3. System.out.println(number2);

  4. Int firstNumber = myObject.number1

  5. myObject.number2 = myobject.number2 + 1

  6. System.out.println(getProduct);

  7. Int myProduct = myObject.getproduct

If his homework is understandable, and these are wrong, please tell me why, I'm really trying here. If they're right, I'd also like to know why, I feel like I'm blindly writing things down hoping it's correct with very little understanding of how it actually works.

I've spent an hour on question 8 trying to read through past lectures to figure out why I'm not getting it. I just feel if he would teach us proper java instead of handing us half of the work, not explaining how it does what it does, and then expecting us to figure out on our own to fill in the blanks, I'd understand this. Hell, even some internet tutorial would be useful at this point.

0 Upvotes

4 comments sorted by

4

u/desrtfx Out of Coffee error - System halted Apr 10 '14

4

u/[deleted] Apr 10 '14

I have to agree, the first questions are very direct and should be straightforward. And about half of the answers given are wrong.

1

u/Speedzor Apr 10 '14

I haven't read your existing answers, but the question describes the solution perfectly. Just write up whatever stands there in code, all you have to do is translate a few words to Java syntax. Make an attempt and it'll go a lot easier.

1

u/OldNedder Apr 10 '14

I usually want at least 2 or 3 different sources of information when learning a programming language. So yeah, try an online tutorial. You can also try codingbat.com

Are you writing programs to test the snippets? It seems odd that he just has you write the answers out. So find a tutorial that has you running short programs. Head First Java might be a good book for you.

Regarding your homework, he doesn't always provide you with a location for your function/method call. For example, in 2 and 3, if you are calling those functions from outside of the object, then you should reference them with the dot notation: myObject.number1 and myObject.number2. Same with getProduct. And you need parentheses and proper casing on getproduct: myObject.getProduct()

Important: Java is case-sensitive.