I have written the script but reached a stopping part on the isPalindrome portion at the end. I have tried running the and keep recieveing a message such a [}parsing}}.
Can someone guide me in the right direction.
import java.util.Scanner;
public class Palindrome{
/**Main Method */
public static void main(String args[]){
//Create a Scanner
Scanner input = new Scanner(System.in);
//Prompt user to enter three intergers
System.out.print("Enter first integer: ");
int n1 = input.nextInt();
System.out.print("Enter second integer: ");
int n2 = input.nextInt();
System.out.print("Enter third integer: ");
int n3 = input.nextInt();
System.out.print("Enter fourth integer: ");
int n4 = input.nextInt();
System.out.print("Enter fifth integer: ");
int n5 = input.nextInt();
System.out.printf( "The total number is " + n1 + n2 + n3 + n4 + n5);
}
}
/** Return the reversal of an integer, i.e. reverse(456) returns 654 */
public class method1{
public static int reverse( int n1, int n2, int n3, int n4, int n5){
return reverse;
}
/** Return true if number is palindrome */
public class PalindromeCheck {
public static boolean isPalindrome(int number)

New Topic/Question
Reply




MultiQuote









|