5 digit Palindrome

    Question by:
    On

    Topics:

    Does anyone have any feedback on how to write a program that inputs a 5-digit integer from the keyboard and prints if the input number is a palindrome or not.

    This is the program I wrote:

    import java.util.*;
     class Tester22
    {
          public static void main(String args[])
          {
          int palindrome number =0;
                int n1 = Integer.parseInt(number);
                Scanner input = new Scanner(System.in);
                System.out.println("Please input a 5-digit number);
                int given = input.nextInt();
                If(number >="Is a palindrome number");
                else
                If (number >="Is not a palindrome number");
                System.out.println(" number + palindrome");
                System.out.println("number += not a palindrome");
          }
    }
    The compilation left me with this result:'

    ';' expected')'                      line 6


      ')' expected                      line 10


    'else' without 'if'                 line  12


    I have tried everything to make this program compile.   I will keep at it!  While someone gives me a hand.



    Fred








    Good Question?
    0

    Featured Post

    Hire Top Freelancers to Complete Java Projects

    Source the talented Expert Exchange community
    for top quality work on your Java projects.

    Hire the best. Collaborate easily. Get quality work.

    Top Expert Contributor

    Essential articles and videos from the Experts

    For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

    More valuable questions with Expert answers

    Question: hi, what is xml xsd validation free tool to download. i checked stulus it is only 15 days free trial.please advise any open source good ones>

    Answer: Hi, Try Notepad++ and install plugin (XML tools) from plugin manager. You can validate against XSD and DTD Thanks, Shail

    Question: Hi Team, I need some one to explain me the below xml mappings for namespace <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...

    Answer: The following fragment: (CODE) indicates that the elements and data types used in the schema come from the "http://www.w3.org/2001/XMLSchema" namespace and they will be identified with the prefix xsi:. Among several definitions this namespace...

    Question: hi, how to you can convert my non maven project to a Maven project and the Maven plugin should download the source for me. please advise

    Answer: In Eclipse, right-click the project, go to "Configure," and choose "Convert to Maven Project."

    Question: I would like to make a piece of code that swap first and last words in sentence. I come up with some solution as you can see below. However, the program doesn't work well. Please help me to find mistake. You code will be much appreciated ! NOW: ...

    Answer: @Sunny here you go (CODE)

    201601-LO-Qu-076

    Extend your technology team with the Experts Exchange community.

    — trusted by —

    Who answers my questions?Our community has technology experts around the world.

    mccarl

    1,480

    Solutions

    Expert in:

    • Java
    • Java EE
    • JSP
    • Programming-Other
    • Algorithms

    CEHJ

    16,919

    Solutions

    Expert in:

    • Java
    • Java EE
    • Editors IDEs
    • JSP
    • Programming Languages-Other

    zzynx

    3,065

    Solutions

    Expert in:

    • Java
    • Apache Flex
    • Adobe Flash
    • Editors IDEs
    • Miscellaneous

    dpearson

    917

    Solutions

    Expert in:

    • Java
    • Java EE
    • JSP
    • Programming-Other
    • Game Programming

    Amitkumar Panchal

    516

    Solutions

    Expert in:

    • Java
    • Java EE
    • JSP
    • Oracle Database

    Jim Cakalic

    1,248

    Solutions

    Expert in:

    • Java
    • Java EE
    • JSP

    dravidnsr

    719

    Solutions

    Expert in:

    • Java EE
    • JSP
    • Java

    awking00

    2,178

    Solutions

    Expert in:

    • Oracle Database
    • Query Syntax
    • Databases-Other
    • MS SQL Server
    • Java

    Moussa Mokhtari

    92

    Solutions

    Expert in:

    • JavaScript
    • jQuery

    RELATED TOPICS view all topics

    1. Java EE
      (16,944)
    2. Editors IDEs
      (24,918)
    3. JSP
      (15,278)
    4. Programming-Other
      (51,582)
    5. Programming Languages-Other
      (19,530)
    6. Java App Servers
      (6,800)
    7. Web Servers
      (31,944)
    8. Web Languages/Standards-Other
      (39,383)
    9. JavaScript
      (118,132)
    10. Oracle Database
      (77,512)