This site requires JavaScript, please enable it in your browser!
Greenfoot back
BilalSLSS
BilalSLSS wrote ...

2019/2/13

I need help for school ASAP

BilalSLSS BilalSLSS

2019/2/13

#
I am a new programmer in grade 11 using greenfoot, I started by using Scratch and did ok in it but now that we have advanced to greenfoot I am doing really bad. I need help in my homework which is to: Create a Chicken and make it fly left and right by changing the argument to the fly(int) method. 2. Create a Chicken and modify its name by invoking the setName(String) method. Put double quotations around the argument. Heres the code: import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) public class Chicken extends Actor { private String name; public void act() { move(1); } public void fly(int distance) { move(distance); } public void setName(String newName) { name = newName; } }
danpost danpost

2019/2/14

#
BilalSLSS wrote...
I need help in my homework which is to: Create a Chicken and make it fly left and right by changing the argument to the fly(int) method. 2. Create a Chicken and modify its name by invoking the setName(String) method. Put double quotations around the argument. << Code Omitted >>
What have you tried?
You need to login to post a reply.