04.04.2013 Views

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

String[]toppings;<br />

int salsaTemperature;<br />

//3 constructors--default, basic, monster<br />

//default burrito recipe constructor<br />

BurritoRecipe (){<br />

}<br />

//regular burrito recipe constructor<br />

BurritoRecipe (String tortillaFlavor, String beanType, ➥<br />

String meatType){<br />

//initialize properties<br />

this.tortillaFlavor = tortillaFlavor;<br />

this.beanType = beanType;<br />

this.meatType = meatType;<br />

}<br />

//monster burrito recipe constructor(uuummmm)<br />

BurritoRecipe (String tortillaFlavor, String beanType, ➥<br />

String meatType, String[]toppings, int salsaTemperature){<br />

//initialize properties<br />

this.tortillaFlavor = tortillaFlavor;<br />

this.beanType = beanType;<br />

this.meatType = meatType;<br />

this.toppings = toppings;<br />

this.salsaTemperature = salsaTemperature;<br />

}<br />

//get/set methods<br />

int getSize() {<br />

return this.size;<br />

}<br />

void setSize(int size) {<br />

this.size = size;<br />

}<br />

String getTortillaFlavor(){<br />

return this.tortillaFlavor;<br />

}<br />

void setTortillaFlavor(String tortillaFlavor){<br />

this.tortillaFlavor = tortillaFlavor;<br />

}<br />

String getMeatType(){<br />

return this.meatType;<br />

}<br />

OBJECT-ORIENTED PROGRAMMING<br />

315<br />

8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!