Paul LaBrier

Greenhorn
+ Follow
since Apr 08, 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 Paul LaBrier

Thank you for that explaination. That makes perfect sense. I should have thought of that.
Paul LaBrier
21 years ago
In order to get th output of a console app to pause and keep the results from scrolling off the screen I did the following.
public static void main(String args[])
throws java.io.IOException
{
exercise7dot8a();
System.out.print("\n\nPress ENTER to continue:");
System.in.read();
exercise7dot8b();
System.out.print("\n\nPress ENTER to continue:");
System.in.read();
exercise7dot8c();
System.out.print("\n\nPress ENTER to continue:");
System.in.read();
exercise7dot8d();
System.out.print("\n\nPress ENTER to continue:");
System.in.read();
exercise7dot8e();
}
[/CODE]
When I compiled and executed it on a Sun Sparc20 running Solaris 7 it worked fine. When I tried it on Win98se it would only pause the first and third time. It would skip the second and fourth time. I recompiled it on Win98se and no change.
Does anyone have any ideas what causes this?
Paul LaBrier
21 years ago
I needed the same thing for a console app I was writing for a class.
What I settled on was:

It worked ok. The user could type until their fingers fell off and nothings happened until they pressed enter.
Paul LaBrier
21 years ago
I have a simple console application that I need to insert a pause in.
Basically I am wanting a "press any key to continu" type thing.
I thought that I should be able to do it with:
System.out.read()
but I cannot seem to get it to work.
I tried searching the internet and could find very little on this topic.
Any suggestions?
Paul LaBrier
21 years ago
Frank, Thanks for the detailed response. It will solve my problem AND teach me a lot in the process. What more could I want!
Paul
21 years ago

What's this for? I have a feeling that maybe the whole conversion process should be in a method, which takes the 2D array as a parameter, and returns the 1D array. Without more idea of what you are trying to do, that may be way off, though.


This is only portion of the mian method. What i am doing is taking the 2D array, chopping off the first column and the creating a 1D array of the rest. The first column is an ID and the remaining columns are data.
Moving that entire conversion process into a method is exactly what I am trying to do.
Thanks,
Paul
21 years ago
Gettings again.
I am trying to create a method , to clean up main but I am having trouble.
My code is as follows:

I would like to move the creation of justGrades[] into another method, but every attampt I have made has failed.
Any suggestions would be helpful,
Paul LaBrier
21 years ago
BINGO! Thanks, I knew it was something like that, but after staring at it a while it was all going fuzzy.
You know, if arrays start their cointing at 0, why does array.length start with 1? Seems a bit inconsistant to me.
Paul
21 years ago
BINGO! Thanks, I knew it was something like that, but after staring at it a while it was all going fuzzy.
You know, if arrays start their cointing at 0, why does array.length start with 1? Seems a bit inconsistant to me.
Paul
21 years ago
I need to take all of the data in a double subscripted array, except for the first column, and add it into a new single subscripted array. I HAVE to do it by code, I cannot simply retype the data into the new array. I created the following as a test case and it works except for the fact that it throws an exception upon execution. I added test output to see where the problem is, but I am not finding it. I am sure it something very simple.
The error I get is:
java.lang.ArrayIndexOutOfBoundsException: 3
at ArrayCopyDemo.main[Compiled Code}
Any help will be appreciated,
Paul
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ August 12, 2002: Message edited by: Dirk Schreckmann ]
21 years ago
I have an double subscripted array:
int grades[][] = { { 2772, 126, 169, 194, 177 },
{ 3375, 163, 188, 189, 185 },
{ 4456, 171, 190, 186, 198 } };
The first column is a ID# and the rest are grades.
I would like to create a new single subscript array that only contains the grades. What would be the best way to do this?
Thanks,
Paul
21 years ago
Why would someone recommend using (String[] args) vs. (String args[]) in calling the main method? What is the difference?
Thanks,
Paul LaBrier
21 years ago
I am pretty sure the answer to my question will be NO, but I will ask anyway.
For a homework assignment in my Into to Java Class I have to write a simple program that will take user input in the for of a string for gallons and miles driven and compute the MPG. I have the program doing what I need it to for the assignment, but I would like to go a small step further. I do not like the fact that it is using two dialog boxes to input the two numbers. Is there any way, still using "JOptionPane.showInputDialog" ( or something close to it) to request both strings within the same dialog box? I know that I could make a custom dialog box, but that is well beyond the scope of the assignment.
Below is a snippet of code showing what I am currently doing.
// input new value for miles and
// convert from String to int
inputMiles = JOptionPane.showInputDialog(
"Enter miles (-1 to quit):" );
miles = Integer.parseInt( inputMiles );
// read second number from user as String
inputGallons = JOptionPane.showInputDialog(
"Enter gallons:" );
Again, I have the assignment done, just looking to improve it.
Thanks,
Paul LaBrier
21 years ago
I am fairly new to java, just finished Intro to Java 2 at a community college. I would like to start to learn more about using JDBC and Oracle 8i.
Can anyone recommend a good book on the subject?
Paul
Is there a Free/Trial version of Oracle 8i for student use? I am wanting to learn JDBC and they use Oracle 8i ( or will be upgrading to it soon*)at work and I would like to learn on that on my server at home.
It would be for non-commercial educational use only.
Is there such a thing?
Paul LaBrier
* Yes I know this is version old already, but that is how far behind they are where I work. Only advantage is that I can save a bundle buying version old used books