Reputation: 55 Whiz
- Active Members
- Active Posts:
- 191 (0.22 per day)
- 13-July 12
- Profile Views:
- Last Active:
- Sep 14 2014 05:24 PM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Who Cares
- Dream Kudos:
Posts I've Made
Posted 14 Sep 2014Im not sure if what I just did its the correct way to write code.
From what I understand, there isn't a 'correct' way to write code; there are, however, efficient/conventional ways of writing code. If it gets the job done, it's pretty correct. Not everyone thinks like this though.
And yes, your error happens when you get to n == 119. It's still less than the checked value so you're continuing to the next multiple. Personally, I would move my check/increment(s) somewhere else, but that's just me.
I was able to solve this with a for loop and an if statement. However, I'm not sure if that is efficient either
Posted 25 Aug 2014Here's a short debugging tutorial for Netbeans.
I'm going off on a tangent here but do you know if there is a difference between Eclipse and Netbeans as far as programming is concerned?It's considered 'cheating' to speak with one another and problem solve together. We do not use a textbook because he believes in 'logical' thinking.
:facepalm: to your professor. That does not make sense. Oh well, good luck to you.
Dream In Code is the best site on the net to get programming help (in my humble opinion)
Posted 25 Aug 2014This is literally the first thing I have ever worked on with Java and the professor had us start with this for homework. We do not use a textbook in this class, we are also not supposed to receive help from classmates.
Not to be rude but what is wrong with your professor. Why do you all not use a textbook and why can't you receive help from classmates?
Posted 25 Aug 2014Do you know how to debug and step through your code? It is an essential skill.
If you step through the code, examining variables, you will be able to discover where it starts to go wrong.
As a side note, I need to learn more about debugging myself. I messed around with the Eclipse debugger but I didn't really know what I was doing.
I found this website : Java Debugging with Eclipse - Tutorial.
Perhaps this site will be useful to myself as well as the OP.
Posted 25 Aug 2014As modi123_1 mentioned about the different data types, how did you get the program to compile in the first place because Eclipse shows red on my end?
Also, what were you going to do with int cents; because that variable is not being used in the code you posted.
- Member Title:
- D.I.C Head
- Age Unknown
- March 24
- Programming, Web development, video games, exercising, guitar
- Full Name:
- Jason H.
- Years Programming:
- Programming Languages:
- Java, HTML5/CSS3