Jason Batchelder

Ranch Hand
+ Follow
since Jan 27, 2005
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 Jason Batchelder

Ajax and PHP together, hmm. While a "old hand" at PHP, I'm just starting to study Ajax. So far it looks very interesting.
At first I wanted to store the data into a database to add more functionality but couldn't figure out how to do it. If that way is easier then please inform me how to do it.

As for the file format, here is what I have.

The first field is a string name. This can be of any length.

The second field is an integer. Maximun 2 places. (No day of the month is larger then that.)

The third field is a double. Once again I will not know how long this is because all bills are not the same. That's all the fields.

I do have them entered with a comma and a space. So the format would look like this.

Electric Bill, 23, 74.99
Car Payment, 17, 299.89
etc.
18 years ago
a simple txt file. I didn't want to get to complicated. At least not right away.
18 years ago
Hello all.

I'm very close to completing my very first complete Java application but I ran into a problem that I can't figure out how to solve. So I came here to my favorite place for Java answers.

Here's what I'm doing.

The first part of the program takes three pieces of information from you and slaps it into a file. The information is as follows in this order: Bill name, date due, amount due.

The second part takes a number of days from you and reads the file pulling out all the bills that fit between today's date and the number of days you put in.

I got the first part done without to much diffuculty, it's the second part that I'm having trouble with. I can get today's date, and add the required number of days to it. I can't however seem to figure out how to read the file and retrieve the relevant bills only. I can get all of them but I can't seem to figure out how to search the file by the date.

Any help would be apperciated.
18 years ago
I have a date question. Which is better Date or Calendar for the following application.

I want to get today's date. I then want to add an amount of days to that date for a projection. For example, let's say today is April 15 and I want to do a projection that is from today's date to say, 25 days from now.

Would I use Date or Calender?
18 years ago
The problem was mainly in the for loops. They were not inserting the elements properly. Thus were causing the program to fail. The first for loop I was using the wrong counter if I remember right.

The second one I changed it to the final section of code.


It also helped that I changed the checks to reflect that I was using cstr1 instead of str1. Oops. Oh well live and learn and I'm learning so I must be living.

Oh, before I forget, tester without the capital letter was a mistake I made almost the first week of class. I made the class to test something that I thought would work, (hence the name). Since it was such a great name, describing exactly what the class is for, I never remade it but just keep using it week after week. I just tranfer what works into my real class when I'm done.

Have fun all and keep programming.

"We don't know one millionth of one percent of anything." -Thomas Alva Edison
18 years ago
It's really very simple. One problem at a time.

Since I can only handle one problem at a time, that's exactly how I do it.

This way every problem is just "one last one"
18 years ago
Just letting everyone know I got the program up and running and everything works. Thanks for your help everyone!
18 years ago
Because I never heard of it and don't know how it works.
18 years ago
Ok, I finally got the string correct. I should have been using nextLine() instead of next(), kudos for you for figuring that one out. So now that that was correct I ran the program again. It picked up the blank space, printed the message, then included the space into the array. ???

All was going fine until that point.

Also my check to see if the two arrays are equal no longer works even if there is not a space in the string. Is it just me or did I just do a trade to get one thing working only to lose something that did work. I even set it up as seperate vars. The cleaned version of the array is not even being used in the checks and my checks still don't work unless this section of code is blocked out.

???

So what's going on?

I'm getting more and more confused by the minute and I hate to keep bugging you guys about this.
18 years ago
I know that it's bad form for a lower case letter begining a class name, however tester is not the final class. I just put things in there to get them to work. Usually no one see this class.
18 years ago
If I did, I did it without ever writing the code. I don't really know what's going on. As for the scanner class, I really don't think that's where my problem is but since I'm new to Java it could be. If I block out the code that checks for a blank space, which I did in the code I posted, everything works. (Except for when you enter in a space that is.)
18 years ago
Sorry I was trying to save some space by posting only the code that didn't work but if you want here's the whole program.

18 years ago
Thanks. I'm finding that Java is not the easiest language I've ever learned and this forum is really helping me. I'm recommending it to all the people I know who are trying to learn also to learn Java.
18 years ago
You got it.

Here it is:



Hey everyone I just have to say that I really appreciate your help with this.
18 years ago