can someone help me Im having trouble with my assingment, we have to debug two java programs and get them to be able to compile...they are still giving me errors. can somone help me see what im missing. here are the codes.
// Convert from Meters to Feet and Inches
The program should repeatedly input a length in meters
and then print that length in feet and inches.
private class MeterToFtIn
{
public static void main(String[ ] argv)
{
double meter, f, i;
int more;
Scanner console = new Scanner(System.in);
System.out.print("Do you wish to input another length in meters: ");
more = con.nextInt( );
more = more.toUpperCase( );
while(more.charAt(0) = 'Y')
{
System.out.print('Enter length in meters: ');
meter = con.nextDouble( );
f = meter * 3.28083989501312;
feet = (int) f;
inches = (int) (12 * (feet - f) + 0.5);
System.out.print("The length is ");
if (feet == 1)
System.out.print(feet + "foot ");
else
System.out.print(feet + "feet ");
if (inches == 1)
System.out.println(inches + " inch.");
else if (inches < 1)
System.out.println(inches + " inches.");
else
System.out.println(".");
System.out.print(
"Do you wish to input another length in meters: ");
more = con.next( );
more = more.toUpperCase;
}
}
}
--------------------------------------------------------
heres the second one
// Check to see if an input string is a palindrome
// orig is the original string,
// processed is the string after removing all characters
/ that are not letters and converting to upper case.
Public class PalindromeCheck
{
private static void main(String argv)
{
string orig, processed, letter;
int left, right;
Scanner con = new Scanner(System.out);
System.out.println("Enter a string:");
orig = con.next;
for(i = 0; i < orig.length( ); i++)
{
letter = orig.charAt(i);
if (Character.isLetter(letter))
processed += Character.toUpperCase( );
}
if (processed.length( ) < 0)
{
left = 0;
right = processed.length( );
while (left < right)
{
if (processed.charAt(left) != processed.charAt(right))
System.out.println("String is not a palindrome.");
else
System.out.println("String is a palindrome.");
left++;
right--;
}
System.out.println("String is a palindrome.");
}
}
}