Question

5 digit Palindrome

Asked by: Fred_45559

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








This question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Sign Up Now!
Asked On
2006-12-19 at 19:19:11ID: 22098769
Tags

palindrome

,

number

Topic

Java Programming Language

Participating Experts
4
Points
500
Comments
17

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

Companies like CVS, Honeywell, Chevron, Toyoto, TriStar Pictures, the U.S. Army, and Accenture

Your Complete Technology Resource

900+ topic areas (and counting)

Related Solutions

  1. What is __ARGS(... )
    a function be declared , for example, void slhc_free __ARGS((struct slcompress *comp)); what dose the mean?
  2. void printarray (int arg[], int length)
    // arrays as parameters #include <iostream.h> Can someone explain the following code for me. so u initial n, and when n is less than length do you cout<< arg[] or n++?? void printarray (int arg[], int length) { for (in...
Tutorials are great ways to tackle hard problems!

Featured Articles

Read through articles written by top experts!

Get full access to the help you need.

Subscribe Now

30-day free trial. Register in 60 seconds.

The Latest Technology News and Tips

Your answer is only minutes away!

New Solutions Everyday

Because of our active community of experts, on average new questions receive their first comment in under 30 minutes.

Top Java Questions

       

Hear What our Users are Saying

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

20130221-EE-VQP-038

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Development.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Microsoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...an excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans