Wednesday
April 23, 2014

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

probability - out of 250 students interviewed at a community college, 90 were ...
Computer Science - What is the fastest way to compare two strings containing ...
algebra - jordan has two numbers that have the sum of 64. those same two numbers...
Computer science - Assume you have a computer that contains 1GB of memory. It ...
Math - Suppose you have two numbers. The difference of the two numbers is 12. ...
computer - What does tenure track, part time instructor of computer science does...
Alegebra 2 - Two numbers have a ratio of 7:5. The sum of teh two numbers is 960...
computer science - write a program to select the classes that you are taking(Ex...
computer science - write a program that prompts the user to input three numbers...
elementry - What characteristic do the numbers 8, 10, 15, 26, and 33 have that ...

Search
Members