sitevelo.blogg.se

Greenfoot chapter 2 shouthorray error
Greenfoot chapter 2 shouthorray error









greenfoot chapter 2 shouthorray error
  1. #Greenfoot chapter 2 shouthorray error how to#
  2. #Greenfoot chapter 2 shouthorray error code#

ShowText("Virus Missed: " + numberOfVirusMissed, 80, 350) ShowText("Virus Touched: " + numberOfVirusTouched, 88, 330) ShowText("Bacteria Missed: " + numberOfBacteriaMissed, 92, 310) ShowText("Bacteria Touched: " + numberOfBacteriaTouched, 100, 290) This.numberOfVirusMissed = numberOfVirusMissed Public void setNumberOfVirusMissed(int numberOfVirusMissed) This.numberOfVirusTouched = numberOfVirusTouched

greenfoot chapter 2 shouthorray error

Public void setNumberOfVirusTouched(int numberOfVirusTouched) This.numberOfBacteriaMissed = numberOfBacteriaMissed Public void setNumberOfBacteriaMissed(int numberOfBacteriaMissed) This.numberOfBacteriaTouched = numberOfBacteriaTouched Public void setNumberOfBacteriaTouched(int numberOfBacteriaTouched) ShowText("Time is up- you win! \nYour final score: " + score, 360, 180) * a white blood cell and the lining at the edge of the blood stream. * Prepare the world for the start of the program. * Create new floating objects at irregular intervals.ĪddObject(new Bacteria(), 779, Greenfoot.getRandomNumber(360)) ĪddObject(new Virus(), 779, Greenfoot.getRandomNumber(360)) ĪddObject(new RedCell(), 779, Greenfoot.getRandomNumber(360)) * Constructor: Set up the starting objects. * It's a place where blood cells, bacteria and viruses float around. * The bloodstream is the setting for our White Blood Cell scenario. Import greenfoot.* // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

#Greenfoot chapter 2 shouthorray error code#

Here's the code for my bloodstream, my virus and my bacteria: However, the issue I've been pulling my hair out over for the last two hours is that I can't seem to correctly implement incrementing for numOfBacteriaMissed and numOfVirusMissed. So far, I have implemented the setters and getters, and have successfully implemented incrementing for numOfVirusTouched and numOfBacteriaTouched. In order to call the public getter and setter, you need to first obtain an instance (handler) of the class Bloodstream. And that is why we provide each variable with a public setter and getter in step 1 above. Hint: first, you can use the public getter to obtain the current value of the variable, and then increase this value by one, and then use the public setter to set this increased value back to the variable.

#Greenfoot chapter 2 shouthorray error how to#

How to increase any of the above variables by one? Here's the exact instructions of the part I am stuck on: Hi, I'm taking a Java course right now, and my homework requires me to build upon WBC-4 by adding getters and setters for numOfBacteriaTouched, numOfBacteriaMissed, numOfVirusTouched, and numOfVirusMissed.











Greenfoot chapter 2 shouthorray error