Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!

Adam Jones

Greenhorn
+ Follow
since Aug 22, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Adam Jones

ok, one more question and then i should have this....i think
i have changed this part and now it works....well, kind of

after that it will read the file in correctly and store the strings where they need to go, but then when i try to compare them i am getting a NullPointerException....i believe this means a programmer error in any case, so if you could take a quick look back through it i would be thankful
thank you for all of your help
adam
[ October 14, 2003: Message edited by: Adam Jones ]
20 years ago
ok, i am having a terrible time with this
i am not sure if the following is what anyone else would do, but it is what i did. if you could, would you take a quick look at it and see if there is anything obvious that i am really messing up
it compiles and when i try to run it i get a NoSuchElementException. in the while loop when i try to fill my String arrays with usernames and passwords. i thought it looked fine but it is not
anyways, any help offered would be greatly appreciated

thank you
adam
[ October 14, 2003: Message edited by: Adam Jones ]
20 years ago
hello everyone. i am working on an extra-credit lab for my java course and i am in need of assistance.
i am just not getting this part right here.

what i want that part of the code to do is read in a whole line from a comma separated value text file(format -- username,password) and store it to the string userOrPass and then break it up and call an instance of another class (instance is the log. ) and pass a string to it to store it in an array of strings and then do the same with passwords.
i keep getting NoSuchElementExceptions
is there something in the code that some of you notice or should i post both classes?
thanks in advance for any help
adam
20 years ago

is there an easier way to get this done?
thanks for any help
adam
20 years ago
wonderful, thank you for all of your help
[ August 15, 2003: Message edited by: Adam Jones ]
20 years ago
i hope no one took the time to work on this using any amount of brainpower....i was working on it a while ago and found my problem. i was trying to grasp the whole interface thing and not mess it up and while i was working with my classes i ended up removing all of the nice little lines that actually called the methods that calculated everything. the code i posted was code i was working on while i was at school and when i got home i opened up the same project that i was working on(i was farther on the code at home but had time to kill at school so i tried to catch up and all) and found that the method calls were in there and everything worked fine with the corrrect code
so if anyone tried to sift through my crap, thank you very much for the attempt and i am sorry if i wasted any of your time
one question though:
the whole interface thing...is it important enough to use often? it seemed to me that i could just as easily put everything in the classes themselves. Of course, this was a tiny project and i am sure a huge project that needs to use the same methods would make use of interfaces. Is that right? Feedback ?
thanks again
adam jones
20 years ago
oops, i just noticed something i forgot to remove from one of the sections of code
in the last code section the Economy class, the (double x)

is not supposed to be there....i was giving something a try and it did not work....just forgot to take it out
20 years ago
ok, i am in a java class right now and i have worked ahead a few labs and i am completely stuck on something right now. the lab requires the use of an interface for a rental car program. i made all of my classes and the interface but when i try to run it and enter the information i get a zero for the two outputs that i should have numbers in.
if at all possible could anyone offer any idea as to what i am doing wrong or what i forgot....also, all constructive criticism will be more than welcome....many thanks for any time that you put into helping me
this is the test class i wrote(sorry, none of the code posted have comments yet)

this is the interface provided with the java course

this is one of the classes i wrote for each car class needed (Economy, Midsize, Luxury) each of the other two classes are exactly alike with the appropriate words substituted for each car category

sorry about the lenght of this post
adam jones
20 years ago
hey folks,
i was wondering if anyone out there has an idea of where to find information out about error codes in BlueJ. it explains some errors, but others it does not. if anyone knows of a list of error codes from BlueJ i would greatly appreciate being let in the loop.
thanks for your time
adam
hey folks,
i was wondering if anyone out there has an idea of where to find information out about error codes in BlueJ. it explains some errors, but others it does not. if anyone knows of a list of error codes from BlueJ i would greatly appreciate being let in the loop.
thanks for your time
adam
21 years ago
i am really sorry about that....i didn't realize that it would post like that...i hope you will still help me out on this one
i will pay more attention next time
adam jones
21 years ago


I didn't use the @return because you don't really return a value from your compute method.


ok, i would, but my wonderful professor....which by the way can't answer a question at all and will offer not one idea to try....insists we follow his standards....failure to do so will result in the lab not being graded
here is the listing from his Programming Standards Sheet




so that is why it is like that

and.....


Somebody suggested using an Array or ArrayList for the change. There's a rule about software that suggests if you're seeing code repeated you should refactor to do that functionality once (if you can) - in this case I believe you can.
See if you can store the change in an array. You'll want the change stored in descending order (25, 10, 5, 1) and then iterate through the array and do your calculations for each coin.


you wouldn't happen to have a site that gives details about how to correctly and effectively use arrays would you?
sorry i am not catching on to all of this
adam jones
[ edited to break apart obnoxiously long line -ds ]
[ August 30, 2002: Message edited by: Dirk Schreckmann ]
21 years ago
ok, now what in the world am i going wrong with on this one???
it is still my first sitting of writing it out so it is not all perfect or scrunched down yet so bear with me....
at the end will be sample outputs

ok, for an input of:
Please Enter Amount of Sale:
1.20
Please Enter Amount Tended:
1.78
it gives me this
quarters
2.0
dimes
0.0
nickels
1.0
pennies
3.0
now to me that adds up
but for this input:
Please Enter Amount of Sale:
1.35
Please Enter Amount Tended:
2.00
Quarters
2.0
Dimes
1.0
Nickels
0.0
Pennies
4.0
it seems to me that it is a penny off....and in the first place it should not have pennies listed anyways....
could someone please read through all of the code and offer me a hint or two...i have lloked at it so long i would never be able to catch anything
thanks again in advance
adam jones
21 years ago
i am still really new to this so please give me some time
ok, for a lab i have to do i need to create a change counter...you know like the ones at gas stations where it auto-dispenses your change? well, my problem is this...i am hitting a wall on how to get this done...what needs to be done is this:
this will be an input from a user
amount of sale: lets say 1.35
another input from user
amount tended: 2.00
display on screen:
Change is .65
Quarters = 2
Dimes = 1
Nickels = 1
i am thinking it will just be a loop that compares the change amount to a final value of quarter and if it is larger, then .25 will be taken from it and some value keeping track of the number of quarters will be ++'d and so on and so forth with each coin value
am i right and if so could you please help me out with a few hints? is it possible to do in just one class or do i have to make a class for each coin?
well, back to work for now
thanks in advance for any help
adam
p.s. i work at Boise Cascade Office Products in Columbus, OH....if you need office supplies, check out www.bcop.com <====just figured i would do my part for the company
21 years ago
thanks for the reply, but what i was looking for was a press any key...i used the unicode value for enter "2324 and then just did a readLine() and it gave me the same results, but that is not what the prof wants i mean it worked just fine by me, but you know how professors are
is there just a way to pause and wait for any response at all from the keyboard?
i am very sure there has to be, but how would that be done?
thanks again for your input
adam
21 years ago