What is the difference between a function definition and a function call?
A function definition describes a routine; a function call executes its body with particular argument values. Defining a function normally does not run its body immediately.
Study 06. Procedures and Functions with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is the difference between a function definition and a function call?
A function definition describes a routine; a function call executes its body with particular argument values. Defining a function normally does not run its body immediately.
How do parameters differ from arguments?
A parameter is a variable in a function definition; an argument is the actual value supplied when the function is called.
What does a return statement do?
return sends a result back to the calling code and ends the current function call. Statements after an executed return are not run.
What does Python return when a function ends without a value?
If a Python function reaches its end without returning a value, it returns None.
How do positional and default arguments work?
Positional arguments normally match parameters in order. A default parameter value is used when that argument is omitted, as with exponent=2 in power(5).
What is local-variable scope?
Scope is the region where a name can be accessed. A variable created inside a function is usually local to that function call and cannot normally be accessed directly outside it.
Why should functions minimize dependence on global variables?
Passing required data as parameters and returning results explicitly makes a function’s dependencies visible. Heavy reliance on global variables makes programs harder to test and understand.
What is a side effect?
A side effect changes something outside the function, such as printing output, modifying a shared list, changing a file, or updating a user interface.
What characterizes a pure function?
A pure function depends only on its parameters and returns a result without changing outside state. The same inputs produce the same output.
What is decomposition in programming?
Decomposition divides a large problem into smaller subproblems, each handled by a function with a clear responsibility.
What does function abstraction provide?
An abstraction hides implementation details behind a simpler interface. Users need the function’s name, inputs, and result rather than every statement inside it.
What qualities make a function useful?
A useful function has a focused purpose, descriptive name, clear parameters, a predictable return value or side effect, and minimal hidden global-state dependence.
A practical review of the integrated Java skills, debugging habits, algorithm reasoning, and free-response strategies needed for AP Computer Science A.
A progressive guide to designing, operating, and testing systems that continue useful service despite component faults, overload, data loss, and recovery challenges.
A medium-difficulty quiz on how independently operated networks, protocols, addresses, naming systems, transport services, and routing mechanisms work together to form the Internet.
Learn how to create, modify, traverse, and analyze Java lists with ArrayList, wrapper types, standard algorithms, and the Collections utility class for AP Computer Science A.
Build a clear understanding of Java Boolean expressions, logical operators, selection statements, nested branching, equivalent logic, and systematic code tracing for AP Computer Science A.
A practical introduction to Java program structure, data types, operators, input and output, problem-solving strategy, testing, and debugging for AP Computer Science A.
A practical guide to Java inheritance, constructor chaining, method overriding, polymorphism, access control, and object behavior for tracing and writing AP Computer Science A programs.
A focused guide to Java classes, object references, constructors, methods, strings, wrapper classes, and API usage for AP Computer Science A.
A focused guide to Java primitive types, expression evaluation, numeric conversion, floating-point behavior, integer overflow, and common methods in the Math class for AP Computer Science A.
A focused review of Java primitive types, expression evaluation, numeric conversion, arithmetic behavior, Math methods, randomness, and tracing techniques for AP Computer Science A.
A progressive guide to how packet-switched networks encapsulate data, move it across links, and manage delay, throughput, queues, and congestion.
A structured guide to designing parallel and distributed systems through decomposition, communication, coordination, state management, scalability, and fault tolerance.