Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 15 of 15

Thread: Simple error can't figure out.

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Simple error can't figure out.

    Trying to write a standard deviation program. Everything was going good until this 1 error started in my class and I can't figure it out.

    My error is at the bottom on Line 70: possible loss of precision
    found : double
    required: int

    import java.lang.*;
    import java.util.*;
     
    class Standard_Deviation
    {
        static int mean = 0;
        static int sums = 0;
        static int subtracted = 0;
        static int squared = 0;
        static int divided = 0;
        static int sqroot = 0;
     
        protected int array[];
     
        static Scanner console = new Scanner(System.in);
     
        public Standard_Deviation(int size)    //Write out the input/output in this class.
        {
            System.out.println("How many values?");
            size = console.nextInt();
     
            array = new int[size];
     
            System.out.println("Enter your value(s).");
            for (int n = 0; n < array.length; n++)
            {
                array[n] = console.nextInt();
            }
     
            System.out.println();
     
        }
        public int getSums()
        {
            for (int n = 0; n < array.length; n++)
            {
                sums += array[n];
            }
            return(sums);
        }
        public int getMean()
        {
            for (int n = 0; n < array.length; n++)
            {
                mean = sums / array.length;
            }
            return(mean);
        }
        public int getSquare()
        {
            for (int n = 0; n < array.length; n++)
            {
                subtracted = array[n] - mean;
                squared = subtracted * subtracted;
            }
            return(squared);
        }
        public int getDivide()
        {
            for (int n = 0; n < array.length; n++)
            {
                divided = squared / array.length;
            }
            return(divided);
        }
        public int getSquareRoot()
        {
            for (int n = 0; n < array.length; n++)
            {
     //Line 70 error           sqroot = Math.sqrt(divided);
            }
            return(sqroot);
        }
    }

    Thanks in advance.


  2. #2
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Simple error can't figure out.

    Quote Originally Posted by n00bprogrammer View Post
    Trying to write a standard deviation program. Everything was going good until this 1 error started in my class and I can't figure it out.

    My error is at the bottom on Line 70: possible loss of precision
    found : double
    required: int

    import java.lang.*;
    import java.util.*;
     
    class Standard_Deviation
    {
        static int mean = 0;
        static int sums = 0;
        static int subtracted = 0;
        static int squared = 0;
        static int divided = 0;
        static int sqroot = 0;
     
        protected int array[];
     
        static Scanner console = new Scanner(System.in);
     
        public Standard_Deviation(int size)    //Write out the input/output in this class.
        {
            System.out.println("How many values?");
            size = console.nextInt();
     
            array = new int[size];
     
            System.out.println("Enter your value(s).");
            for (int n = 0; n < array.length; n++)
            {
                array[n] = console.nextInt();
            }
     
            System.out.println();
     
        }
        public int getSums()
        {
            for (int n = 0; n < array.length; n++)
            {
                sums += array[n];
            }
            return(sums);
        }
        public int getMean()
        {
            for (int n = 0; n < array.length; n++)
            {
                mean = sums / array.length;
            }
            return(mean);
        }
        public int getSquare()
        {
            for (int n = 0; n < array.length; n++)
            {
                subtracted = array[n] - mean;
                squared = subtracted * subtracted;
            }
            return(squared);
        }
        public int getDivide()
        {
            for (int n = 0; n < array.length; n++)
            {
                divided = squared / array.length;
            }
            return(divided);
        }
        public int getSquareRoot()
        {
            for (int n = 0; n < array.length; n++)
            {
     //Line 70 error           sqroot = Math.sqrt(divided);
            }
            return(sqroot);
        }
    }

    Thanks in advance.
    I think the Math class returns a double.


    Try casting it to an int:

    sqroot = (int) Math.sqrtrt(dividend);

    I think it needs a () around the word int, but try {} if it doesn't work.

    or try

    squroot = int (Math.sqrt(dividend)); if it still doesn't work.

  3. The Following User Says Thank You to javapenguin For This Useful Post:

    n00bprogrammer (September 29th, 2010)

  4. #3
    Junior Member
    Join Date
    Apr 2010
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Simple error can't figure out.

    sqroot = (int) Math.sqrt(divided); got it. Thanks bro

  5. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Simple error can't figure out.

    Your computations are going to be wrong if you do all the math using ints. For example: 11/6 = 1

  6. The Following 2 Users Say Thank You to Norm For This Useful Post:

    javapenguin (September 29th, 2010), n00bprogrammer (September 29th, 2010)

  7. #5
    Junior Member
    Join Date
    Apr 2010
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Simple error can't figure out.

    Quote Originally Posted by Norm View Post
    Your computations are going to be wrong if you do all the math using ints. For example: 11/6 = 1
    Thanks a lot.. I switched everything to doubles and took the (int) off of the Math.sqrt.. everything compiled but my calculations for the sqrt are showing 0.0

    EDIT: I thought it would have been because I have static double sqroot = 0; and that might have been throwing it off so I took off the = 0 but it did nothing; still showing 0.0
    Last edited by n00bprogrammer; September 29th, 2010 at 09:01 PM.

  8. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Simple error can't figure out.

    Did you remove ALL of the integer divisions?

  9. #7
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Simple error can't figure out.

    You have dividend set to 0. What if you called getDivide()?


     sqroot = Math.sqrt(getDivide());
     
            return(sqroot);

    and in getDivide()

    dividend = getSquare()/array.length;

    Also,
    you could've

    squared = Math.pow(subtracted,2);

    which would have done the same thing as what you did.

    May not do much more in this case than what you did, but it works better if you're cubing it or higher.

    Math.pow(number,power);

  10. The Following User Says Thank You to javapenguin For This Useful Post:

    n00bprogrammer (September 29th, 2010)

  11. #8
    Junior Member
    Join Date
    Apr 2010
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Simple error can't figure out.

    Well I removed all of the ones I thought were necessary.. On the methods with division I also tried changing the variablehere / array.length to variablehere / array[size] but it didn't make a difference.

    Here's my code now..
    class Standard_Deviation
    {
        static int size;
        static double mean = 0;
        static double sums = 0;
        static double subtracted = 0;
        static double squared = 0;
        static double divided;
        static double sqroot;
     
        protected int array[];
     
        static Scanner console = new Scanner(System.in);
     
        public Standard_Deviation(int size)    //Write out the input/output in this class.
        {
            System.out.println("How many values?");
            size = console.nextInt();
     
            array = new int[size];
     
            System.out.println("Enter your value(s).");
            for (int n = 0; n < array.length; n++)
            {
                array[n] = console.nextInt();
            }
     
            System.out.println();
     
        }
        public double getSums()
        {
            for (int n = 0; n < array.length; n++)
            {
                sums += array[n];
            }
            return(sums);
        }
        public double getMean()
        {
            for (int n = 0; n < array.length; n++)
            {
                mean = sums / array[size];
            }
            return(mean);
        }
        public double getSquare()
        {
            for (int n = 0; n < array.length; n++)
            {
                subtracted = array[n] - mean;
                squared = subtracted * subtracted;
            }
            return(squared);
        }
        public double getDivide()
        {
            for (int n = 0; n < array.length; n++)
            {
                divided = squared / array[size];
            }
            return(divided);
        }
        public double getSquareRoot()
        {
            for (int n = 0; n < array.length; n++)
            {
                sqroot = Math.sqrt(divided);
            }
            return(sqroot);
        }
    }

  12. #9
    Junior Member
    Join Date
    Apr 2010
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Simple error can't figure out.

    Wow sqroot = Math.sqrt(getDivide()); just did it. Thanks you guys are awesome.

  13. #10
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Simple error can't figure out.

     for (int n = 0; n < array.length; n++)
            {
                sqroot = Math.sqrt(divided);
            }
    This loop is doesn't do anything useful. In fact most of your loops are useless. Very few of them use the loop index.

    There is a lot of mysterious code in your program that I have no idea what it is supposed to be doing.
    Can you add comments on most of the lines of code describing what they do?

  14. #11
    Junior Member
    Join Date
    Apr 2010
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Simple error can't figure out.

    Sure.
    class Standard_Deviation
    {
        static int size;    //static variables.
        static double mean = 0;
        static double sums = 0;
        static double subtracted = 0;
        static double squared = 0;
        static double divided;
        static double sqroot;
     
        protected int array[];    //protected variable
     
        static Scanner console = new Scanner(System.in);
     
        public Standard_Deviation(int size)    //constructor
        {
            System.out.println("How many values?");    //prompts input from the user.
            size = console.nextInt();    //stores the input
            System.out.println();
     
            array = new int[size];    //declared array
     
            System.out.println("Enter your value(s).");    //prompts more input.
            for (int n = 0; n < array.length; n++)
            {
                array[n] = console.nextInt();    //stores input.
            }
     
            System.out.println();
     
        }
        public double getSums()    //getSums method.
        {
            for (int n = 0; n < array.length; n++)
            {
                sums += array[n];    //adds data.
            }
            return(sums);
        }
        public double getMean()    //getMean method.
        {
            mean = sums / array[size];    //divides data to get the average.
            return(mean);
        }
        public double getSquare()    //getSquare method.
        {
            for (int n = 0; n < array.length; n++)
            {
                subtracted = array[n] - mean;    //subtracts mean from the array
                squared = subtracted * subtracted;    //multiplys results.
            }
            return(squared);
        }
        public double getDivide()    //getDivide method.
        {
            divided = squared / array[size];    //divides data.
            return(divided);
        }
        public double getSquareRoot()    //getSquare Root method.
        {
            sqroot = Math.sqrt(getDivide());    //uses Math.sqrt to get the square root of the divided data.
            return(sqroot);
        }
    }

    I thought the for loops were needed to loop through array[n] that's why I used them.. I have no idea why I used them for every method but I took out the ones I thought weren't needed.

    My instructor is new and isn't all that great so she has been putting out sample programs and I've been having to use them to try to learn and do the projects. This project was to program a standard deviation calculator using a class and the driver with a main method. Here's the driver.

    import java.lang.*;
     
    public class Standard_Deviation_Driver
    {
        public static void main(String[] args)
        {
            Standard_Deviation sd = new Standard_Deviation(2);
     
            double a = sd.getSums();
            double b = sd.getMean();
            double c = sd.getSquare();
            double d = sd.getSquareRoot();
            double e = sd.getDivide();
     
            System.out.println("Sum: " + a);
            System.out.println("Mean: " + b);
            System.out.println("Squared: " + c);
            System.out.println();
            System.out.println("Standard deviation: " + d);
     
        }
    }

  15. #12
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Simple error can't figure out.

    Another useless loop. squared only set from the last loop.
       for (int n = 0; n < array.length; n++)
            {
                subtracted = array[n] - mean;    //subtracts mean from the array
                squared = subtracted * subtracted;    //multiplys results.
            }

    I took out the ones I thought weren't needed.
    Is this programming by random copy and pasting?
    You need to have a design for what you want the program to do before you start coding.

    divided = squared / array[size]; //divides data..
    The comment is redundant. You can see that there is a divide there.
    What value is in squared and what value is in the array at index size? Why do you want to divide squared by the element at index size?

  16. #13
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Simple error can't figure out.

    Quote Originally Posted by n00bprogrammer View Post
    Sure.
    class Standard_Deviation
    {
        static int size;    //static variables.
        static double mean = 0;
        static double sums = 0;
        static double subtracted = 0;
        static double squared = 0;
        static double divided;
        static double sqroot;
     
        protected int array[];    //protected variable
     
        static Scanner console = new Scanner(System.in);
     
        public Standard_Deviation(int size)    //constructor
        {
            System.out.println("How many values?");    //prompts input from the user.
            size = console.nextInt();    //stores the input
            System.out.println();
     
            array = new int[size];    //declared array
     
            System.out.println("Enter your value(s).");    //prompts more input.
            for (int n = 0; n < array.length; n++)
            {
                array[n] = console.nextInt();    //stores input.
            }
     
            System.out.println();
     
        }
        public double getSums()    //getSums method.
        {
            for (int n = 0; n < array.length; n++)
            {
                sums += array[n];    //adds data.
            }
            return(sums);
        }
        public double getMean()    //getMean method.
        {
            mean = sums / array[size];    //divides data to get the average.
            return(mean);
        }
        public double getSquare()    //getSquare method.
        {
            for (int n = 0; n < array.length; n++)
            {
                subtracted = array[n] - mean;    //subtracts mean from the array
                squared = subtracted * subtracted;    //multiplys results.
            }
            return(squared);
        }
        public double getDivide()    //getDivide method.
        {
            divided = squared / array[size];    //divides data.
            return(divided);
        }
        public double getSquareRoot()    //getSquare Root method.
        {
            sqroot = Math.sqrt(getDivide());    //uses Math.sqrt to get the square root of the divided data.
            return(sqroot);
        }
    }

    I thought the for loops were needed to loop through array[n] that's why I used them.. I have no idea why I used them for every method but I took out the ones I thought weren't needed.

    My instructor is new and isn't all that great so she has been putting out sample programs and I've been having to use them to try to learn and do the projects. This project was to program a standard deviation calculator using a class and the driver with a main method. Here's the driver.

    import java.lang.*;
     
    public class Standard_Deviation_Driver
    {
        public static void main(String[] args)
        {
            Standard_Deviation sd = new Standard_Deviation(2);
     
            double a = sd.getSums();
            double b = sd.getMean();
            double c = sd.getSquare();
            double d = sd.getSquareRoot();
            double e = sd.getDivide();
     
            System.out.println("Sum: " + a);
            System.out.println("Mean: " + b);
            System.out.println("Squared: " + c);
            System.out.println();
            System.out.println("Standard deviation: " + d);
     
        }
    }


    Wouldn't the methods in the first class have to be static too to be used in the main method of the second class? I thought static methods could only call other static methods.

    Maybe I'm wrong.

  17. #14
    Junior Member
    Join Date
    Apr 2010
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Simple error can't figure out.

    Quote Originally Posted by Norm View Post
    Another useless loop. squared only set from the last loop.
    Is this programming by random copy and pasting?
    You need to have a design for what you want the program to do before you start coding.
    I never copy and pasted anything. My instructor told me to use the for loop when I asked for her help on the very first method I wrote, then I just assumed I needed to do it for every method. As my user name states.. I am very new to java programming and I don't know much.

    What do you mean by design? Like a flow-chart? I've never been taught any kind of outline or flow-chart to make for a program.

  18. #15
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Lightbulb Re: Simple error can't figure out.

     System.out.println("Enter your value(s).");
            for (int n = 0; n < array.length; n++)
            {
                array[n] = console.nextInt();
            }

    this is going to ask the user to enter the values only once, but expect them to enter it array.length times.

            for (int n = 0; n < array.length; n++)
            {
              System.out.println("Enter your value."); // since it's only asking for one at a time, enter change it
     // to singular. True, they could enter them all at once with a space, but still.
                array[n] = console.nextInt();
            }

    this asks them to enter values array.length times and expects array.length inputs.

     public Standard_Deviation(int size)    //constructor
        {
            System.out.println("How many values?");    //prompts input from the user.
            size = console.nextInt();    //stores the input
            System.out.println();
     
            array = new int[size];    //declared array
     
            System.out.println("Enter your value(s).");    //prompts more input.
            for (int n = 0; n < array.length; n++)
            {
                array[n] = console.nextInt();    //stores input.
            }
     
            System.out.println();
     
        }

    Why would a constructor ask for the size value? Couldn't your test program do that instead?

     public Standard_Deviation(int size)    //constructor
        {
          size = this.size; // hopefully this statement doesn't make it equal to 0.  
            array = new int[size];    //declared array
     
            System.out.println("Enter your value(s).");    //prompts more input.
            for (int n = 0; n < array.length; n++)
            {
                array[n] = console.nextInt();    //stores input.
            }
     
            System.out.println();
     
        }

    import java.lang.*;
     
    public class Standard_Deviation_Driver
    {
        public static void main(String[] args)
        {
         int size = 0;
      System.out.println("How many values?");    //prompts input from the user.
            size = console.nextInt();    //stores the input
            System.out.println();
            Standard_Deviation sd = new Standard_Deviation(size); // unless you wanted a 2, but the way it is 
    // now will work with constructor and every time you need to use the value size.
     
     
     
            double a = sd.getSums();
            double b = sd.getMean();
            double c = sd.getSquare();
            double d = sd.getSquareRoot();
            double e = sd.getDivide();
     
            System.out.println("Sum: " + a);
            System.out.println("Mean: " + b);
            System.out.println("Squared: " + c);
            System.out.println();
            System.out.println("Standard deviation: " + d);
     
        }
    }

     public double getSums()    //getSums method.
        {
            for (int n = 0; n < array.length; n++)
            {
                sums += array[n];    //adds data.
            }
            return(sums);

    I think this will go through the loop and only return the value it has at the end of the loop.

     public double getMean()    //getMean method.
        {
            mean = sums / array[size];    //divides data to get the average.
            return(mean);
        }

    this is dividing sums, or getSums() if you changed it, by the value in the index size of your array.
    However, arrays start at 0, so your max index is array[size-1]. What you're doing right now is dividing by the value in an index that isn't there!

    public double getDivide()    //getDivide method.
        {
            divided = squared / array[size];    //divides data.
            return(divided);
        }

    Again, that index doesn't exist.

    I'm not sure if you're hoping to divide by the element at array[size -1 ] or if you're hoping to get the value
    divided by array.length, so I can't be more specific in that area.

     public double getSquare()    //getSquare method.
        {
            for (int n = 0; n < array.length; n++)
            {
                subtracted = array[n] - mean;    //subtracts mean from the array
                squared = subtracted * subtracted;    //multiplys results.
            }
            return(squared);
        }


    n = 0;

    subtracted = array[0] - mean;

    squared = Math.pow(subtracted,2);

    n = 1;

    subtracted = array[1] - mean;

    squared = subtracted * subtracted; // same as Math.pow(subtracted, 2)

    n = 2;

    subtracted = array[1] - mean;
    squared = Math.pow(subtracted,2);

    n = array.length - 1;

    subtracted = array[array.length - 1] - mean;
    squared = Math.pow(subtracted, 2);

    end loop

    return value for last squared value calculated.

    I don't think it's saving your values before that.


    if you're hoping to get all the values, you could do this:


     public void getSquare()    //getSquare method.
        {
            for (int n = 0; n < array.length; n++)
            {
                subtracted = array[n] - mean;    //subtracts mean from the array
                squared = subtracted * subtracted;    //multiplys results.
     
           System.out.println(squared);
    }
        }

    However, if you do this, you'll have to update your method call in Driver and anywhere else you might have called getSquare().

    I'm not sure what the code below will do:

     public double getSquare()    //getSquare method.
        {
            for (int n = 0; n < array.length; n++)
            {
                subtracted = array[n] - mean;    //subtracts mean from the array
                squared = subtracted * subtracted;    //multiplys results.
                   return(squared);
            }
     
        }
    but it's very possible your return value will be lost when the loop ends so I wouldn't recommend writing it that way.

    Also,

            for (int n = 0; n < array.length; n++)
            {
              System.out.println("Enter your value."); // since it's only asking for one at a time, enter change it
     // to singular. True, they could enter them all at once with a space, but still.
                array[n] = console.nextInt();
            }

    should be in the Driver class.

    If you made the array public, or at least default (visible to all in package but none outside package), put two classes inside same package.

    default looks like this

    int array[];

    protected is for classes that are in the same package, that can access protected as well I've heard, or for classes that extend, or inherit methods from other classes.


    You could do this:

    import java.lang.*;
     
    public class Standard_Deviation_Driver
    {
        public static void main(String[] args)
        {
         int size = 0;
      System.out.println("How many values?");    //prompts input from the user.
            size = console.nextInt();    //stores the input
            System.out.println();
     
     
            Standard_Deviation sd = new Standard_Deviation(size); // unless you wanted a 2, but the way it is 
    // now will work with constructor and every time you need to use the value size.
    int [] array2 = new int[sd.array.length];
       for (int n = 0; n < array2.length; n++)
            {
              System.out.println("Enter your value."); // since it's only asking for one at a time, enter change it
     // to singular. True, they could enter them all at once with a space, but still.
                array2[n] = console.nextInt();
               array2[n] = sd.array[n];
    System.out.println();
    }
     
    // that may work.  If not, you still need to have that line asking for each of the values in the Driver class.  //You shouldn't be asking for input directly from the user using console.next Whatever  or //Whatever.parseWhatever.   
     
     
            double a = sd.getSums();
            double b = sd.getMean();
            double c = sd.getSquare();
            double d = sd.getSquareRoot();
            double e = sd.getDivide();
     
            System.out.println("Sum: " + a);
            System.out.println("Mean: " + b);
            System.out.println("Squared: " + c);
            System.out.println();
            System.out.println("Standard deviation: " + d);
     
        }
    }

    Also, when using the variables in the regular, non-Driver Standard_Deviation class, try to use getValue() instead of value.

    Like this:

     mean = getSums() / array[size];    //divides data to get the average.
            return(mean);

      divided = getSquare() / array[size];    //divides data.
            return(divided);

    Also, if you get the message: non-static method cannot be referenced from a static context, or something like that, change your methods to static in first class.
    Last edited by javapenguin; September 30th, 2010 at 03:09 PM.

  19. The Following User Says Thank You to javapenguin For This Useful Post:

    n00bprogrammer (September 30th, 2010)

Similar Threads

  1. I'm new at this and can't figure it out
    By jaheh06 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: September 22nd, 2010, 08:44 AM
  2. Can not figure out my programs error!
    By mparkerj in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 16th, 2010, 10:48 AM
  3. Error of data types and type casting in java program
    By chronoz13 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: September 2nd, 2009, 10:22 AM
  4. simple problem w/ appelets which i cant figure out
    By JavaGreg in forum Java Applets
    Replies: 7
    Last Post: August 15th, 2009, 07:22 PM
  5. [SOLVED] Java program to prompt and display the user input number as odd or even
    By napenthia in forum Java Theory & Questions
    Replies: 11
    Last Post: April 22nd, 2009, 01:19 AM