Back to marketplace

U3: User Defined Methods

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

Trial and Error

Back (Answer)

Create program, run it, alter code until desired result

#2
Front (Question)

Stepwise Refinement

Back (Answer)

• Completing program in trial-and-error method closer and closer to solution • Ex: Writing first part of program, perfecting, then continuing

#3
Front (Question)

Divide and Conquer

Back (Answer)

Breaks task into smaller parts

#4
Front (Question)

Modular Programming

Back (Answer)

• Building large programs through combining separate chunks of code • Possible by creating main program, then creating separate subroutines for program

#5
Front (Question)

Method Header

Back (Answer)

• public static void [method] (data) • AKA: Subroutine definition

#6
Front (Question)

Method Body

Back (Answer)

Code of the method

#7
Front (Question)

Modifiers

Back (Answer)

Ex: public and static

#8
Front (Question)

public/private

Back (Answer)

• Access specifier stating where subroutine can be called from • Private: Just within selected part of program • Public: Other parts

#9
Front (Question)

Naming Conventions for Subroutine

Back (Answer)

• Begin with lowercase • Camel notation • Descriptive name • No reserved words

#10
Front (Question)

Static

Back (Answer)

Ensures subroutine can exist on own and not as part of object

#11
Front (Question)

Local Variables Inside Subroutine

Back (Answer)

• Different, simpler name from ones in main program • Only exist within subroutine • Wiped from memory when subroutine done executing

#12
Front (Question)

Program Control for Subroutine

Back (Answer)

• Program control transferred to subroutine when latter is called • Transferred to main program when subroutine done executing

#13
Front (Question)

Procedure

Back (Answer)

Performs task but doesn’t return data to main program; returns void

#14
Front (Question)

Data Transfer from Main Program to Subroutine

Back (Answer)

Write arguments in brackets in same order as parameters

#15
Front (Question)

Function

Back (Answer)

• Performs task and returns data to main program • Return type specified and return statement concludes subroutine

#16
Front (Question)

Return Types

Back (Answer)

Int, Double, String, Void, etc

#17
Front (Question)

void

Back (Answer)

Used when no data returned to main program

#18
Front (Question)

Return Statement

Back (Answer)

return (variable);

#19
Front (Question)

Outputting Data from Method Call

Back (Answer)

• Output to screen on the same line as the method call OR • Use variable in main program to store data

#20
Front (Question)

Methods

Back (Answer)

• Declared within main class • Include both procedures and functions • Can’t return +1 piece of data

#21
Front (Question)

Declaring Parameter

Back (Answer)

Done while declaring subroutine

#22
Front (Question)

Declaring Argument

Back (Answer)

Done while calling subroutine

#23
Front (Question)

Declaring Variables on Same Line

Back (Answer)

Possible for same data type in the main program, not in subroutines

#24
Front (Question)

Subroutine Header

Back (Answer)

Comments explaining subroutine function, inputs and outputs, parameters passed, data returned (if any).