Saturday
April 25, 2015

Homework Help: computer science

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

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

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

Members