Amy Lee

Greenhorn
+ Follow
since Nov 02, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Amy Lee

Hi, I have to write a program for my database class that generates servlets using FORM files. We were not taught this process in class; rather we were expected to learn it on our own time. I've written servlets before directly, but I've never had to automate the process. I'm having a lot of trouble understanding where to start on this project. I'm not looking for someone to write the code for me; rather, I'd like someone to explain very clearly and unambiguously what steps I should take to accomplish this project. I've sought help from the professor with no luck.

Here are the directions he's given us; thanks for your help.

1. write a program that parses a FORM file, collecting its information into internal data structures. Question: I've written code to search a directory for .form files which then stores them into a list:



I don't understand where to go from here. How do I process these forms? Do I parse each form and store it in a list or an array? If so, what does this accomplish?

2. write another program that uses these data structures to create (via JDBC) a relational table in Oracle to contain tuples that will be submitted via this form. Question: I'm assuming this program is used to actually execute the form's actions?

3. write a third program that generates a Java file containing the genform, procform, and aggform methods, as prescribed in the Survey Specification Files]Survey Specification Files (http://www.cs.utexas.edu/users/dsb/CS347/Projects/SurveyFiles.html). Question: I am completely lost as to how I'm supposed to write these methods. Is there even any documentation of these methods in Java? Or are these methods user-defined?

4. automate the creation of Project 1's gateway web site. Question: This step could be cleared up if I understood steps 1-3.

5. automate the creation of a web site given the following FORM specifications. An example set of forms is here (http://www.cs.utexas.edu/~hamid/cs347/form-examples.html). Question: Same as above.
[ April 25, 2006: Message edited by: Bear Bibeault ]
18 years ago
I need help! I'm writing code to traverse a tree, find a given character, and then print out it's path labels. It's basically for Huffman coding. I've written the following, but it just goes on and on. Can someone help? Thanks!

18 years ago
max_cycle_length() computes the maximum cycle length inclusive and between two integers based on the 3n + 1 problem (Collatz Problem - see MathWorld.com).

Yes, the instructor gave us all the I/O code. The only code block we had to write was max_cycle_length().

I typed in <Ctrl> + Z and got back a NumberFormatException. Previously, I tried typing in -1 and got back a NoSuchElementException. I also tried hitting <ENTER> and I got back a NoSuchElementException as well.

It seems no matter what I type in I get some sort of an exception.
19 years ago
Hi all, I'm working on some code for an assignment and I'm receiving a runtime error. Our professor provided us with the I/O code for the program and we only had to complete the code for max_cycle_length(); I've attached the code below.

Can someone help me figure out what could be causing this error? I cannot figure it out; the code performs the calculations correctly, but I can't get the program to terminate without throwing an exception. Thanks for any help - let me know if I need to post more info.

19 years ago
I kind of understand - I definitely understand the part about splitting into two methods, but I'm not sure that my professor would be OK with that.

So I'm interested in the first proposition; are you saying to pass two different parameters? Because I don't think I can do that (I mean I can, but would probably get points counted off). I tried "storing" the intial value somewhere in the method, but nothing works since N is repeatedly updated thru recursion...unless I'm missing something?

Amy
19 years ago
Can someone please help???
19 years ago
I have written up the following code:



When I pass printBinary(13), I want it to print "13 in base 2 is 1101." I understand why it's printing "0 in base 2 is 1101," but I can't figure out how to somehow "store" the 13 so that I can use it in my S.O.P. method. Any help is GREATLY appreciated. Thanks!

Amy
19 years ago
Beautiful - thanks for helping me to understand!
19 years ago
OK, so if it was instead:



...then it would only print to the base case since there is no System.out.println() method after the recursive call anymore, right? In other words, since there's no print or return method, there is no place for the method to "unleash itself" visually, right?

Thanks.
19 years ago
Could someone please explain to me, as simply as possible, why the following:



...prints out:

7 performing recursive step
5 performing recursive step
3 performing recursive step
1 performing recursive step
-1 at base case.
1 done with recursive step
3 done with recursive step
5 done with recursive step
7 done with recursive step

...when b(7) is called? I understand how it it from 7 to -1, but I thought it would stop there since there was no return statement after the if statement. What causes it to wrap back up and perform the "done with recursive step" S.O.P. method?

Thanks!!!
19 years ago
I've written a method to count the number of words in a string. I realize there is probably a method in the Java Documentation library that could make this short and sweet, but our teacher isn't allowing us to use it. I compiled my code and received the error "operator || cannot be applied to char, char" - here is my code:



How else can I specify in my if statement that if i = to any of the characters listed in the parentheses, i is not a letter? Please help - thanks!
19 years ago
Never mind, I just figured it out - there was a typo in my for loop; THANKS ANYWAY! :-)
19 years ago
I created the following constructer to create a deck of 52 cards, but when I call the method it gives an out of bounds exception. Since my variable ais an ArrayList, I thought that the array would resize each time I added to it. The cursor is positioning itself at a.addwhen it throws the exception. Here is my code - any help would be appreciated; thanks!

19 years ago
Thanks.
19 years ago
Thanks for your feedback - I thought the same thing when I extended Card, but I wasn't sure if I was correct. My teacher gave us an assignment and he provided a Card class for us to use, yet he wants us to create a StandardDeck class (and a Hand class). I automatically thought "extend Card," but I see that I'm wrong.

How can I call methods from the Card class without extending it to StandardDeck?
19 years ago