Which tutorial are you using?Quote:
Originally Posted by llsmr777
Do you mean you don't understand the examples or that you can't write code that is similar to the examples?Quote:
Originally Posted by llsmr777
Printable View
Which tutorial are you using?Quote:
Originally Posted by llsmr777
Do you mean you don't understand the examples or that you can't write code that is similar to the examples?Quote:
Originally Posted by llsmr777
I've been on a few websites but mostly on the java.sun website and my school book.
A little of both. I've only been given about 6 weeks to learn all this and its been tough. Out of about 15 students there are only 4 of us left. Everyone else dropped out.
Most of my code is just examples I've taken and tried to accomodate what I need. But it's been so hard that I haven't even done most of my assignment right I'm just trying to get some of it so I can get some credit.
Java is a required class for my degree but I havne' t used it and will never use is in my current job. Tha'ts not to say I wouuld never want to learn it because I do but it would need to be more paced and with more direction.
OK, that's tough especially since I guess this isn't your only subject.Quote:
I've only been given about 6 weeks to learn all this
However my advice hasn't changed, look at how much time you've wasted by trying to get simple things to work. I realise they don't seem simple to you but that's because you don't understand the basics. Dlorde often posts the following quotation and for good reason.
"If I had eight hours to chop down a tree, I would spend 6 hours sharpening an axe... Anon".
BTW when do you have to hand this assignment in by?
Can you post the assignment question, your design and the code so far.
Well not only is this not my only subject but I also work full time plus I have 3 kids all school aged that always need help on their homework. My husband works swing so he's not able to assist me.
Anyways enough of my sob story. I really have been trying but even just reading the basics is hard to comprehend esp with no real direction since its an online class. i really think java needs to be instructor led.
I did post my code in an earlier post. The entire code.
I have to turn this in on Monday.
I have to have a program that lists DVD's, has a button for First, Last, Next, Previous, Save - to save to a file, Load - to load the file, Modify, Delete, and Search!
I have designed it to look right but haven't gotten all the buttons to work.
I also haven't exactly done the assignment right because I was supposed to use methods and subclasses to calculate a restock fee and total inventory. But I tried to fix it and I couldn't and since I have so little time I have to just move on and try to get as much of it to work as I can so I just hard coded the restock and entire inventory total. I'm sure I'll get docked big time but oh well. I have had to work on previous assignments because they were wrong and I think that the instructor is giving people time over the due date to redo things because of his drop out rate.
I can see where that can be a problem. Plus having kids & already having a fulltime job...etc. I give a lot of people this link & for good reason: it covers just about all of the material in a Java Intro course AND more. It's an excellent guide for the novice programmer:Quote:
Originally Posted by llsmr777
http://leepoint.net/notes-java/
I hope that helps. Starting out in Java can be tough (speaking from experirence). You have probably heard this before but it is really great advice: Dissect your problem into smaller programs and combine those programs to create your final product. You would be amazed of how simple something is when you do it this way.
Take this example programming problem:
"I want a program that will manage my bank account"
In the real world, that's about all the information you get.
Let's break that sentence down some:
Hmm...manage a bank account...what will I probably need?
*Maybe a couple of instance variables to hold quantity, price, account No. etc.
*Need some data structure to store these fields in
*How many methods should I use ? (withdraw method, deposit method, etc.)
Some helpful questions to ask yourself:
What "is" a bank account ?
What do you mean by managing an account?
Who will use this account ?
How will I know if I run out of money ?
Can I transfer funds to another account ?
Basically just take your DVD Assignment and ask these questions the same way.
Last but not least, code in small intervals...meaning don't spend 3 straight hours cranking code. Manage your time and code when you are well rested. That way you can reduce your mistakes and code more efficiently. I know this won't be easy with your current schedule but don't give up.
Keep posting and let us know how you are progressing. Monday is so far away, so stay focused and you will definitely complete this assignment.
Thanks for the post.
i booked mark the site and I am going to look over it later. Hopefully I can fix some of my code!
Thanks again!
Ok I can see your time is limited and you now only have a couple of days left so I would suggest you consider a different plan. I don't know how your assignment will be marked but I would hope a fair number of the marks will be for the analysis and design rather than just on whether the program works. If that is the case (and if it isn't the course is probably not worth passing) and given that writing code is not your strong point at the moment why don't you leave the coding and concentrate on coming up with a good design. By design I don't mean how the GUI looks, I mean defining the classes you need, how they relate to each other and the methods they have. This will give you a basic program structure which, if it's done well, will get you marks. Once you have all your classes and method definitions you can then add code to the methods that give the maximum impact for the minimum work, for example you can cut and paste your existing GUI code in so that the application displays a GUI.Quote:
Originally Posted by llsmr777
If as many people have left the course as you say then they are going to be lenient with the marking else they'll end up with nobody, so you just need to do enough to allow the lecturer to feel he/she is justified in awarding you marks.
Taking a look at each required features:
First, Last, Next and Previous are all related - they move to a particular DVD and display it's contents. Therefore the code for each of these is basically the same. The only difference is how you move the index. First and Last move to one end or other of the list. Assuming the DVD's are stored in a sensible data structure such as an ArrayList then you either set the index to 0 or list.size()-1. Next and Previous simply increment or decrement the index and then check to ensure it's still in bounds, for example if the current index is 0 and Previous is pressed then check to see if it's less then 0 and if it is set it to list.size()-1. Once you have the new index all the methods do the same thing ie get the DVD at this index and display it's contents. You should aim to code these features.
Saving to and Loading from file is possibly too compliated for you so why not just display a message saying "Feature Not Implemented Yet". At least it will show the button is active and will give the impression that you've just run out of time rather than you didn't know how to do it. An even better approach would be to simulate file storage by saving to and loading from an ArrayList, this can be done very easily and as long as you add comments to explain what you've done so it doesn't look like you're trying to cheat I'm sure you get some marks.
Delete is easy. you know the current index so you just need to check the user meant to delete the DVD and then call list.remove(index). Then you need to check the index is still in bounds because if you've deleted the last DVD then the index will be off the end of the list. And finally get and display the DVD at this index.
Modify - you're already displaying the DVD's attributes in JTextFields so the values can be chanegd and when the Modify button is pressed you just need to read each text field and call the appropriate DVD.setXXX() method. It's the same basic code for each TextField so do one, get it working and then just copy the code.
Search is more difficult so given the time constraint I'd resort to the "Feature Not Implemented Yet" message.
Hope this is of some help and good luck.
well it's almost done.
I got all but load and save buttons to work
I really do appreicate all the time each of you have taken to post.
I think the instructor is being lenient because just to know that more than 1/2 your class has dropped has to look and feel bad!!
You're suggestions were really great too! Thank you!!