import greenfoot. *; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class questions here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class asks extends Actor
{
/**
* Act - do whatever the questions wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
// Add your action code here.
int a = Greenfoot.getRandomNumber(10);
int b = Greenfoot.getRandomNumber(10);
int result = a + b;
int answer = Integer.parseInt(Greenfoot.ask("How much is " + a + " + " + b + "?"));
if (result == answer)
{
Message messagebox = new Message("Well Done You Go to The next LEVEl!!!!");
}
else
{
Message messagebox = new Message("You Failed!! Try Again!");
}
}
}me wrote...
what is wring with this comes up that it cant find symbol- method ask(java.lang.string)