Maths Game Android random numbers

  • Replies:3
John mac
  • Forum posts: 2

Mar 11, 2013, 9:57:41 PM via Website

jhhhhhh

— modified on Mar 24, 2013, 3:09:51 AM

Reply
Ashish Tripathi
  • Forum posts: 211

Mar 15, 2013, 12:34:06 PM via Website

Can you share more briefly what you are trying to get and where you are stuck.

Reply
John mac
  • Forum posts: 2

Mar 15, 2013, 1:00:37 PM via Website

Sorry,

I am having problems creating 2 random numbers. Every time i add the code for the second random number, it just replaces the first number generated (I.E only one number being generated). The program aims to generate two numbers. Then the user has to input the correct sum of these random numbers. A suitable message stating whether the user has been correct is also needed.

Reply
Ashish Tripathi
  • Forum posts: 211

Aug 12, 2013, 8:27:43 AM via Website

Hey,

Try it

Random r = new Random();
int a = r.nextInt(50);
int b = r.nextInt(50);
System.out.prinltn(a+"another number"+b);

If still prob share

Reply