You can use this assignment in your class!
Mastery Progress(100.0%)
i

What are the differences between methods, functions, and procedures?

You answeredJUST NOW

(Student response here)

Did you like this question?

(Voting helps us personalize your learning experience!)
imgInstructor solution
Jeff TerrellMAY 10, 2021, 8:54:26 AM

Functions take inputs and return some outputs. Strictly speaking, functions (as in math) should not have any effects (e.g. mutation).

Procedures are functions that might have an effect.

(In class, I am not super strict about my use of 'function' vs. 'procedure'.)

Methods are procedures that are part of a class so have access to this and super. Every method is a procedure but not every procedure is a method.

Was this helpful?

(Voting helps us personalize your learning experience!)
Think you've got it?

What do we gain in our evaluator by only returning the value of the last evaluated expression?

Select one of the following options:
  • A.

    It allows for our interpreter to ingest code that has intermediary steps making it easier to read

  • B.

    It allows for better error handling by being able to verify parameters

  • C.

    It simulates an OOP language where the return statement is the last statement in a method

  • D.

    It allows for methods to cause side effects such as modifying a field such as a counter

Submit answer

Was this helpful?

(Voting helps us personalize your learning experience!)

You may exit out of this review and return later without penalty.