Forum: Java 1 Hour Ago |
| Replies: 15 Views: 254 Stop what you are doing and read the instructions several times. That's always the first thing. You can't do anything until then. When you read them, you'll see that you are not following them. ... |
Forum: Java 12 Hours Ago |
| Replies: 15 Views: 254 There's a key word in your description in post 1 that really affects everything. It says that Student should be an "abstract" class. It's not clear to me why. Is there something else to the spec... |
Forum: Java 14 Hours Ago |
| Replies: 15 Views: 254 Whoops! My bad! I forgot all about the fact that Java doesn't allow unreachable statements. I knew that the "break" commands would never execute, but I got in the habit of sticking them in anyway. ... |
Forum: Java 16 Hours Ago |
| Replies: 15 Views: 254 I think a switch statement would be appropriate here:
public int getQuiz (int quizNumber)
{
switch (quizNumber)
{
case 1: return qz1; break;
case 2: return qz2;... |
Forum: Java 18 Hours Ago |
| Replies: 15 Views: 254 Generally, toString() will not take any parameters. Use the object's data members (StudentName, qz1, qz2, qz3, qz4, qz5) and display them. I cannot think of any reason you'd want to make this a... |
Forum: Java 2 Days Ago |
| Replies: 15 Views: 254 The spec doesn't say anything about making an "array list". It says to make an array.
Make sure that you create an array called myClass.
Java has plain old arrays and it has Collections,... |
Forum: Java 14 Days Ago |
| Replies: 15 Views: 621 One, the rule is that we don't help without effort on your part. Two, you should start your own thread. |
Forum: Java 18 Days Ago |
| Replies: 7 Views: 496 Right now you don't have your Listener(s) set up to do anything. You need to either have:
One listener for both buttons. Within that listener, use getSource() to figure out which button... |
Forum: Java 18 Days Ago |
| Replies: 7 Views: 496 Then you need another JTextField, unless you are using the same JTextField for both the answer and the question (which is fine). Right now you only have one JTextField. So decide where the input... |
Forum: Java 18 Days Ago |
| Replies: 7 Views: 496 Frame and Panel are Java classes. You may want to rename your classes to make it less confusing, or at least be careful and make sure you don't get them mixed up.
What do you want to have done... |
Forum: Java 21 Days Ago |
| Replies: 4 Views: 308 I see nothing in the spec that requires any long-term non-volatile data storage. You enter the input every time you run the program. When the program is over, the input data is gone and the output... |
Forum: Java 24 Days Ago |
| Replies: 3 Views: 191 nextInt (int) requires a positive parameter. You are passing it arr[0], which is 0, which is an error. From the documentation:
... |
Forum: Java 24 Days Ago |
| Replies: 4 Views: 308 Yes, many here can solve it. But you need to show your attempt and ask a specific question. If you do, many people will be happy to help.
http://www.daniweb.com/forums/announcement9-2.html |
Forum: Java 25 Days Ago |
| Replies: 4 Views: 258 One, your class is named Main3, not Main1, so make sure your html file points to the actual class file. I renamed the class to Main1 and compiled it. When I did, it created Main1.class, but it also... |
Forum: Java 26 Days Ago |
| Replies: 4 Views: 258 Looks fine to me. You need to get the error message. Does it work when you run it on a local machine? Try putting Main2.class and the html page in the same folder on your local hard drive and... |
Forum: Java 28 Days Ago |
| Replies: 3 Views: 269 Get the count
Calculate the sum
From the count and the sum, calculate the average.
From the average, get each deviation (error).
Square each deviation (squared error).
Add up the squares... |
Forum: Java 29 Days Ago |
| Replies: 3 Views: 239 Code tags and formatting please. The code is unreadable now as it is.
// code here
Before you can work on the borrowing function, you need to set up your ArrayLists correctly. |
Forum: Java Oct 31st, 2009 |
| Replies: 2 Views: 228 One, code tags. Use them.
// paste code goes here
Two, Where's the error and what is it? Point out a line number. |
Forum: Java Oct 29th, 2009 |
| Replies: 6 Views: 239 Code tags are simply this.
// paste code here
You had it close on your first post. |
Forum: Java Oct 29th, 2009 |
| Replies: 6 Views: 239 Here's your code, formatted and in code tags:
//This is an inventory program that stores
//and lists the inventory of Coaxial Connector-fittings
//Author:
//Class: IT215
//Date: October 17,... |
Forum: Java Oct 25th, 2009 |
| Replies: 2 Views: 220 How the hell would we know? |
Forum: Java Oct 18th, 2009 |
| Replies: 4 Views: 245 Don't create a NEW timer every time in DoJobButtonListener. Your timer does not speed up. Your TIMERS (plural) EACH fire once a second or whatever. Ten timers, each firing once a second, means a... |
Forum: Java Oct 17th, 2009 |
| Replies: 17 Views: 587 Get some trial data that's easy to calculate and that has only 4 or 5 records, not 58 or 59 or 60 or whatever. You need known results that you can quickly check against. Fix the code so it works... |
Forum: Java Oct 16th, 2009 |
| Replies: 17 Views: 587 First, if you haven't already, after you've read in your data, you need to display it to make sure it's reading in correctly. You also need to make sure that the number of elements you are reading... |
Forum: Java Oct 15th, 2009 |
| Replies: 17 Views: 587 You keep writing over the same data because you don't change Index. Index++ should be at the end of the loop. You have 59 lines in your file (I assume those blanks in your first post aren't blank... |
Forum: Java Oct 14th, 2009 |
| Replies: 6 Views: 235 Yes to all of the above. Java can do all of this, or at least it probably can since I don't know what GST is. I don't know that it's worth learning Java just to do that, but you could certainly... |
Forum: Java Oct 14th, 2009 |
| Replies: 17 Views: 587 I think my post 2 is your best approach then:
// declare/set aside space for 5 arrays of the appropriate types of size 59.
// open file
for (int i = 0; i < 59; i++)
{
// read from... |
Forum: Java Oct 14th, 2009 |
| Replies: 17 Views: 587 Yes, very good point. A single array or type Hurricane would be better than several arrays, each containing one part of the hurricane, like the name, date, etc. You should create a Hurricane class.... |
Forum: Java Oct 14th, 2009 |
| Replies: 17 Views: 587 Lines 25, 30, and 35 are in the wrong spots. You need a broader scope for these variables. They will disappear outside of the for-loops they were created in. Declare and set aside space for your... |
Forum: Java Oct 9th, 2009 |
| Replies: 9 Views: 354 Here's a code snippet I wrote in C++ that might be interesting to you.
http://www.daniweb.com/code/snippet217218.html
It has a different approach than your program. There are many different... |
Forum: Java Oct 9th, 2009 |
| Replies: 9 Views: 354 Glad you got it working. Consider this. To test whether a million is prime, how high do I need to test? Currently you test up to half of one million, but you really only need to test up to the... |
Forum: Java Oct 9th, 2009 |
| Replies: 9 Views: 354 OK that's what it should do. Does it actually do that? You need to tell us. Again, if I type 25, what's the goal? Calculate all primes up to 25? Calculate the first 25 primes?
Look at your... |
Forum: Java Oct 9th, 2009 |
| Replies: 9 Views: 354 There are a lot of problems with both the algorithm and the program's implementation of the algorithm. Let's start with primes[]. What should primes[] eventually contain if I enter a max of 25? Is... |
Forum: Java Oct 8th, 2009 |
| Replies: 2 Views: 251 Sounds like there is a lot of math involved. If you refer to a theorem, you should link it:
http://en.wikipedia.org/wiki/Separating_axis_theorem
Is this a math problem or a problem with the... |
Forum: Java Oct 7th, 2009 |
| Replies: 1 Views: 180 We understand that you're an important person and you have a busy life and you thus have neither the desire nor the time to put effort into this, but please realize that you have to at least provide... |
Forum: Java Oct 7th, 2009 |
| Replies: 4 Views: 154 The code is this. Delete the line "new Pawn ()" and delete the entire Pawn.java file and your program will compile and run the exact same way. When you have a line like "new Pawn ()", all that... |
Forum: Java Oct 7th, 2009 |
| Replies: 4 Views: 154 Try setting your Pawn panels to a background color of green or something and see if anything that's displayed ends up being that color. If it isn't displayed, it can't be clicked. You have this... |
Forum: Java Oct 5th, 2009 |
| Replies: 4 Views: 203 You can combine the top code and the bottom code and get...
for (int i = 0; i < cdList.length; i++)
System.out.println(cdList[i].getArtist() + " " + cdList[i].getTitle() + " " +... |
Forum: Java Oct 5th, 2009 |
| Replies: 3 Views: 341 http://www.daniweb.com/forums/thread227475.html |
Forum: Java Oct 5th, 2009 |
| Replies: 10 Views: 392 You have this marked as "Solved", so that means that you don't want people to respond to it anymore. You have a few more threads on the forum. What's the current one? You should have one open and... |