For Programmers: Free Programming Magazines  


Home > Archive > Java Help > October 2006 > Java help needed









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Java help needed
Doraemon

2006-10-21, 12:17 am

to implement this specification.

--------------------------------------
Here contains my answers but when i compile it it contains 5 errors i dont k
now how to solve it. Can anyone help me out with this?

public void actionPerformed(ActionEvent e)
{
int x = (int)textbox.getText();
string result;

if (x % 7 == 0 && x.toString().indexOf("7") > -1)


{
result = "Your number contains the digit 7 and is divisible
by 7";
play(getCodeBase(), "music2.au");
}
else if (x % 7 == 0)
{
result = "Your number is divisible by 7";
play(getCodeBase(), "music1.au");
}
else
{
result = "Your number is not divisible by 7 and does not
contain the digit 7";
play(getCodeBase(), "music3.au");
}

answer.setText(result);
}
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com