Post a New Question

computer science

posted by .

i have two numbers...
i want to check if the first and the last number from a string of these numbers are the same or 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

First Name
School Subject
Your Answer

Related Questions

More Related Questions

Post a New Question