QUOTE(Amadeus @ 25 Apr, 2007 - 06:40 AM)

Can you describe the problem, along with any error messages you are receiving?
CODE
/* PROGRAM NAME: CONVERT_METRES
* THIS PROGRAM IS INTENDED TO CONVERT DISTANCES
* STUDENT NAME: KAMAKIL ARON KEMBOI
* DATE: 23.04.07
*/
import javax.swing.JOptionPane;
import java.text.DecimalFormat;
public class ConvertMetres
{
public static void main (String [] args)
{
//variable declarations
String d1, n2;
int index=0, index1=0, conversions=0;
double [] numbers = new double [10];//array to store distance
boolean invalidNumber = true;
//exception handling
while (invalidNumber)
{
n2= JOptionPane.showInputDialog ("How many numbers do you want to convert?");//prompt for number of distances to convert
try
{
conversions = Integer.parseInt (n2);
invalidNumber =false;
}
catch (NumberFormatException e)
{
JOptionPane.showMessageDialog(null, "You must enter an integer");//error message for try/catch
}
}
for (int count=1; count <= conversions; count++)//loop for distance input
{
do
{
//exception handling
boolean invalidNumber2= true;//boolean declaration for try and catch
while (invalidNumber2)
{
d1 = JOptionPane.showInputDialog ( " Enter a distance " + count + " in metres");//prompt for distance to convert
try
{
numbers [index] = Double.parseDouble (d1);
invalidNumber2= false;
}
catch (NumberFormatException f)
{
JOptionPane.showMessageDialog(null, "Invalid entry");//error message for try/catch
}
}
}
while (numbers [index] < 1);
}
int count2=0;
count2++;
do
{
//index ++;
String choice1 = JOptionPane.showInputDialog ( "Metres to convert: " + numbers [index]
+ "\n 1: Convert to Kilometres \n 2: Convert to inches \n 3: Convert to feet"
+ "\n 4: Quit the conversion \n \n Enter your choice " );// choice dialog box
int choice = Integer.parseInt(choice1);
//if statements for choice
if (choice==1)
showKilometres (numbers [index]);
else if (choice==2)
showInch (numbers [index]);
else if (choice==3)
showFeet (numbers [index]);
else if (choice==4)
System.exit (0);
else{
JOptionPane.showMessageDialog(null, "Invalid entry");//error message for invalid choice entry
}
}
while (count2 < numbers.length);
}
public static void showKilometres (double dist)
{
double kilo = dist * 0.001;
DecimalFormat num = new DecimalFormat ("0.00");//definition of display format
JOptionPane.showMessageDialog(null, +dist+ "metres = " + num.format (kilo)
+ " kilometres");
}
public static void showInch ( double dist) //method to convert to inches
{
double inch = dist * 39.37;
DecimalFormat num = new DecimalFormat ("0.00");//definition of display format
JOptionPane.showMessageDialog(null, +dist+ "metres = " + num.format(inch)
+ " inches");//display of inches
}
public static void showFeet ( double dist) //method to convert to feet
{
double feet = dist * 3.281;
DecimalFormat num = new DecimalFormat ("0.00");//definition of display format
JOptionPane.showMessageDialog(null, + dist + "metres = " + num.format(feet)
+ " feet");//display of feet
}
}
QUOTE(AngeluS @ 25 Apr, 2007 - 06:56 AM)

And place your code in between code tags.
At least that makes it a bit easier to read without having to copy/paste it to an IDE.
Alright. dont think think i did the tag thing right...