computer science

posted by .

i have two numbers...
1564656
1981676
i want to check if the first and the last number from a string of these numbers are the same or not...how would i do that. how would i just compare the first and a last number and ignore the other numbers in this string?

my code so far...

class lotto
{
public static void main(String[] args)
{
JOptionPane.showMessageDialog (null, " LOTTOMAX - PLAY - WIN");
String numgen =JOptionPane.showInputDialog (null, " ENTER 7 DIGIT NUMBER:" );
int playa1 = Integer.parseInt(numgen);
JOptionPane.showMessageDialog (null, playa1);
int LottoRandom = (int)(Math.random()*10000000);
JOptionPane.showMessageDialog (null, LottoRandom);
if (playa1 >10000000 )
{
JOptionPane.showMessageDialog (null, " INVALID NUMBER. ");
}

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. algebra

    find five numbers with a mean of 16, a median of 15 a mode of 21 and a range of 11. hi Anna i hope this helps median is the middle number . mean is all the numbers added up then divided by the amount of numbers. mode is the number …
  2. Computer

    devise a number system based on base 11. a)draw the number line b)show examples of addition and subtraction c)develop a representation of negative numbers based on elevens complement Hi Stephanie: I guess first I want to make sure …
  3. math word problems

    The sum of two numbers is 69. The second is 9 more than 4 times the first. What are the two numbers?
  4. College Algebra

    The sum of two numbers is less than 12. The second number is 8 more than the first. What are the possible values for the first of the two numbers?
  5. algebra

    true or false 1. fraction cant be written as decimal. 2. natural numbers are referred to as counting numbers.whole numbers consists of counting numbers.whole numbers consist of counting numbers as well as the number 0 3. intergers …
  6. Math

    When factoring a trinomial that is in the format Ax^2 + Bx + C, the number that is represented by B should be viewed as the _____?
  7. math

    the binary system is used for computer programming. a binary number consists of a string of digits that are either 0s or 1s a. if a string of binary code is 5 digits long, how many binary numbers are possible if the first digit is …
  8. Grade 8 Math

    Can you write them in Mathematical/numbers form I'll solve them myself. i don't really get it though i have written the first one in mathematical for but i'm not sure if that's right. 1. When six is subtracted from five times a certain …
  9. Algebra

    Four numbers have a total of 92. The first number is twice the second number and the third is 4 more than the sum if the first two. The fourth number is 3 less than the difference of the first two numbers. What are the numbers?
  10. Precalc

    To which set(s) of numbers does the number sqrt -16 belong?

More Similar Questions