Tuesday

September 2, 2014

September 2, 2014

Posted by **gaurav** on Sunday, October 16, 2011 at 8:03pm.

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. ");

}

**Answer this Question**

**Related Questions**

math - the binary system is used for computer programming. a binary number ...

Algebra - Four numbers have a total of 92. The first number is twice the second ...

Grade 8 Math - Can you write them in Mathematical/numbers form I'll solve them ...

algebra - true or false 1. fraction cant be written as decimal. 2. natural ...

Math - Suppose you have two numbers. The difference of the two numbers is 12. ...

math - my number is a multiple of 5, but doesnt end in 5, the prime ...

math word problems - The sum of two numbers is 69. The second is 9 more than 4 ...

math - what is my number? Clue 1 My number is a multiple of 5,but it does not ...

math - It was noticed that some cars have license plates with 3 letters followed...

math - three numbers are in the ratio 6:3:1, and the sum of these numbers is 420...