Im doing the MYCat project and have six errors where the brackets are stating class interface, or enum are expected.
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* MyCat is your own cat. Get it to do things by writing code in its act method.
*
* @author (your name)
* @version (a version number or a date)
*/
public class MyCat extends Cat
{
/**
* Act - do whatever the MyCat wants to do.
*/
public void act()
{
/*checks if cat is bored by calling the method "isBored()" which is inherited from the cat class*/
if(isBored())
{
//If it is bored,then dance
dance();
}
}
}
{
/*checks if cat is hungry by calling the method "isHungry()" which is inherited from the cat class*/
if(isHungry())
{
// If it is hungry, then it eats
eat();
}
}
}
{
//check if cat is tried
if(tired==true)
{
//If so make the cat sleep for some time
sleep(4);
// Then make the cat to shourt hooray
shourtHooray();
}
}
else
{
//If the cats is tired it only shourts hooray
shoutHooray();
}
}
}
{
//check if cat is alone
if(isALone())
{
//If so make the cat sleep for some time
sleep(4)
}
else
{
//If the cat is not alone it shouts hooray
shoutHooray();
}
}
}
