Tuesday, May 20, 2008

a program that reverses the input number applying for loop- while loop or do while loop.

output:
Enter number: 1234
Reversed number: 4321

i am trying to run some utility program on windows XP which needs java should be present in the system- i downloaded the java (j2re1.4.2_04) from the sun site and installed in my D:\program files\java directory. Still i am finding following error message
Windows can not find javaws - make sure you type the name correctly- and then try again.What may be the problem and probable solution of this proble.i am seeking help

Please be simple with your response. I am new at HTML- Java- and PHP and don t understand all of the coding. Therefore- I need good exmples.

A grub is a Critter that burrows from one location to another. A Grub knows how far away it can burrow and randomly chooses the direction in which to burrow. It burrows down from its current location and burrows up at some target location. If the target location is empty or contains a Flower- the Grub moves to this location. If the target location contains any other type of object- the Grub gets stuck underground and dies. You are to implement getMoveLocations below.

public class Grub extends Critter
{
private int maxDistance;
public Grub(int distance)
{
maxDistance = distance;
}

public int getRandomDirection()
{
Int turns = (int) Math.random()*8;
Return Location.NORTH + turns * Location.Half_Right;
}

/** Gets a list of possible locations for the next move. These locations must be valid in the grid of this Grub. Implemented to return all locations in a random direction up to and including the maximum distance that this Grub can borrow.
Postcondition: The state of all actors is unchanged.

public ArrayList<Location>getMoveLocations()
{

I am trying to get a Java program to run on a Linux machine. The program is actually meant for a Mac computer. I want to see if someone with Java experience can help me determine what is causing the program to stall. I was successful in getting it installed on my linux machine and to partially run.

The program is an interface to a database. I get the login screen to appear- but then once I enter my information and hit enter the rest of the program never shows- however- it does appear to connect in the background.

Here is the error when I launch the .jar file from the command screen:

Exception in thread "main" java.lang.IllegalArgumentException: illegal component position

at java.awt.Container.addImpl(Unknown Source)

at java.awt.Container.add(Unknown Source)

I am not a programmer and I am hoping this will make some sense to someone. Any help in resolving this is greatly appreciated!

No comments: