Urgent: How to convert java program into J2ME????

I developed a java program and it is working on J2EE but when I was trying to run it on J2ME,  I had lots of ERRORS... can you pls help me to find the soution for my problem.

Pls help to make it run in a appropriate way....
import java.io.*;
import java.util.Random;
public class math
public static void main (String[] args)throws IOException
DataInputStream stdin = new DataInputStream (System.in);
if (stdin == null){
	System.out.println("Please Insert Valid number");
Random generator = new Random();
int num1;
int num2;
double guess;
double answer;
String string1;
String Quesno;
int incno = 1;
int count = 1;
int score = 0;
while (count < 11){
char[] st = new char[]{'+','-','*'};
int r = generator.nextInt(st.length);
num1 = generator.nextInt(10); //Gets random num1
num2 = generator.nextInt(10); //Gets Random num2
char randomChar = st[r];
Quesno = "Question Number " + incno + " : ";
System.out.println (Quesno + num1 + randomChar+ num2);
if (randomChar == '*'){
answer = (num1*num2);
else if (randomChar == '/'){
	answer = (num1/num2);
else if (randomChar == '-'){
	answer = (num1 - num2);
answer = (num1+num2);
string1 = stdin.readLine();
guess = Double.parseDouble(string1);
if (guess == answer)
System.out.println("Correct, Question (1) answer is " + answer);
score ++;
System.out.println("Wrong Answer, it is "+answer+" Guess again");
System.out.println ("END of Questions");
System.out.println ("Your Score is "+score+"/10");
			}catch (EOFException e){

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cscdubaiAuthor Commented:
I asked This qustion before more than 12 hours, and until now I didn't have any answer for that !!!!
I think you mentioned that if it's urgent you will answer with in 12 hours, but I didn't get any thing yet...
i have already given answer to similar question.

follow the link


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cscdubaiAuthor Commented:
Thanks for replying...

is there any math library in J2ME??
if yes how can use it ?
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.



Math.log() is not available CLDC 1.1 , CLDC 1.1 supports floating point
types, includes several more methods in java.lang.Math, but CLDC's
 is still a subset of the J2SE version of the
cscdubaiAuthor Commented:
why J2me shows this Error for IOExeption and how can I resolve it?

C:\WTK22\apps\math\src\math1.java:8: cannot find symbol
symbol  : class IOException
location: class math1
public static void main (String[] args)throws IOException
u have the answer of your 1st question and now u r asking too  many questions in a single question.

do write your code which is generation exception in another question and i'll answer u there.


I have given the answer to this question and the author started new question in the same question and after getting his answer, he is wants this question to be deleted.

I want the 500 points.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.