Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   More newbie questions. (http://www.alice.org/community/showthread.php?t=4168)

jamieirl 03-30-2010 08:26 PM

More newbie questions.
 
So I've been taking an intro to programming class this semester and we've finished the first portion of our Alice in Action with Java book and now a final project is due with Alice. This project is basically for us (the students) to put everything we've learned on display. Our professor gave us a minimum-requirements list for our program, on this very short list there are a couple requirements that I'm not sure about. I know that I've done everything on the list, I think maybe the terminology he uses might not be exactly how it was worded in the book (I'm also not having much luck using google).

If anyone could put these two requirements in the most newbie wording possible so my brain can realize what it is I need to do, that would be greatly appreciated:

5. Include at least 3 user-defined functions - class-level and/or world-level. ----- I know what a function is and I've used object functions in my past assignments, his wording is throwing me off, though. Could someone please provide an example (newbie example) of a "user-defined function"?

9. Use at least 2 selection statements. ----- Is this where a user based selection is required and the answer be it true or false each lead to a different outcome? Another newbie example would be great.

Thanks in advance, you guys are always very helpful.

dragnet 03-30-2010 11:42 PM

A user defined function or method is one you have created from scratch. In other words if you clicked on the 'create new method' or 'create new function' button in the details pane of the world or any individual object. For example if you have a fish in your world, and you write a 'swim' method for that fish, you have written a user defined method.

Not sure what selection means in the context of your instructor. I have heard of if/else statements being referred to as selection statements. I always refer to them as conditional branching, but I believe in my classroom days some instructors may of called them selection statements.

Best to ask if your not sure.

jamieirl 03-31-2010 12:56 AM

[QUOTE=dragnet;19274]A user defined function or method is one you have created from scratch. In other words if you clicked on the 'create new method' or 'create new function' button in the details pane of the world or any individual object. For example if you have a fish in your world, and you write a 'swim' method for that fish, you have written a user defined method.

Not sure what selection means in the context of your instructor. I have heard of if/else statements being referred to as selection statements. I always refer to them as conditional branching, but I believe in my classroom days some instructors may of called them selection statements.

Best to ask if your not sure.[/QUOTE]

Thank you, that helps clear things up some.

reuben2011 04-05-2010 01:34 PM

I think a selection statement is something that does something based on the trueness/falseness of a condition. So a if/else statement and a while statement would be considered selection statements. A loop could also be considered a selection statement since it actually keeps looping while the counter is less than the amount of times it should loop. I would ask your professor/teacher if looping structures count (you can use my explanation to explain it to him.) And yes, I know trueness is not a word.

jediaction 04-05-2010 02:15 PM

No, i heard selection statements are Variables. I beleive that one


All times are GMT -5. The time now is 09:46 AM.

Copyright ©2021, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.