Documente Academic
Documente Profesional
Documente Cultură
m
m
R BUT A2T!
R Now that we now exactly how to ma e our
apple pie, made a little man to ta e care of
ma ing it, and we now how to change stuff
around and figure out whatǯs going on with
the pie, we need one more thing
R That thing is HAT TM DM 2TH 2T! (a a
methods)
(ë*3%,
/* Mutput :
* The pie is hot = true.
* The diameter of this apple pie is 1..
* The pie is hot = false.
*/
R Normally, you MHMULD chec for everything to
ma e sure it wor s, but that might ta e forever,
so in class they usually have predefined output
they expect
R ith this, remember that you can manipulate
what you have and can ma e this more fancy
(e.g. using an if then statement to ma e the
string equal to hot or cold depending on the
boolean value, and then inserting that into the
output)
R As with normal programs, you can still use
methods (so use them!) Be concise as possible
Ôëë)
P.M. 2f you want to than me, ma e me an apple pie, and NM donǯt ma e me
an apple pie program unless you want to be eaten instead. M=]