this is my code for cakes for age. it works for odd number but when it comes to even number is doesn't work. for (eg) if i put in 77 for the age there is no problem it unless if i key in 24 it doesn't work.
please help?
class MyClara extends Clara {
/**
* In the 'run()' function you can write your program for Clara
*/
void run() {
int height;
height = readInt ("How old is your grandmother?");
while (height > 77)
height = readInt ("Enter a number Less than or = 77");
for (int width = 0; width < 21; width ++)
{
forward();
}
turnLeft();
for (int hw = 0; hw < (height-height % 10)
/ 10 + 3; hw ++)
{
forward();
}
turnLeft();
for (int width = 0; width < 21; width ++)
{
move();
}
turnLeft();
for (int hw = 0; hw < (height - height % 10)
/10 +2; hw ++)
{
backward();
}
turnLeft();
move();
int h = 0;
for (int hw = 0; hw < ((height -(height % 10))
/ 10); hw ++)
{
for (int l = 0; l < 10; l++)
{
putLeaf();
move();
move();
}
if (h == 0)
{
running();
h = 1;
}
else
{
walking();
h = 0;
}
}
for (int i = 0; i < (11 - height % 10); i ++)
{
move();
}
for ( int i = 0; i < height % 10; i ++)
{
putLeaf();
move();
move();
}
}
void forward()
{
putLeaf();
move();
}
void backward()
{
move();
putLeaf();
}
void running()
{
turnLeft();
move();
turnLeft();
move();
}
void walking()
{
turnRight();
move();
turnRight();
move();
}
}