Function Structure

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/14

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 1:55 PM on 4/2/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

15 Terms

1
New cards

Function

group of statements that together perform a task

REASONS:

  • program modularization (easier to understand)

  • code reuse

2
New cards

Function Declaration

Function Definition

Function Call

REQUIREMENTS OF FUNCTION

3
New cards

Function Declaration

tells the compiler about the function type, function name and its parameters

4
New cards

Function Definition

provides the actual syntax inside the function

5
New cards

Function Call

since only syntax inside the main() function will be executed

it implements the function inside the main() function

6
New cards

returnType functionName (parameters) {

(statement)

}

FUNCTION SYNTAX

7
New cards

returnType

can either be int, double, char, string, or bool which will be returned back to the main function after the function execution

8
New cards

functionName

user defined name that is use to reference the function

9
New cards

parameters

variables being passed from the main function to be used in the function

10
New cards

statements

series of syntax to be executed when a function is called.

11
New cards

Function Declaration

Function Definition

Function Call

3 REQUIREMENTS IN USING A FUNCTION

12
New cards

Declaring a Function

identifying the function name as well as the return type and parameters/arguments.

13
New cards

Return type

the variable data type that the function will return back to the main()

14
New cards

parameters/arguments

are variables/values that main() will pass to the functions

15
New cards

main

function must be called by its function name inside the ___() block.

Explore top flashcards

Set 1 (Fall Comp 1)
Updated 905d ago
flashcards Flashcards (25)
B1.1 Lipids
Updated 868d ago
flashcards Flashcards (32)
Ekologija
Updated 445d ago
flashcards Flashcards (104)
MGMT 105 Final
Updated 1173d ago
flashcards Flashcards (228)
Microbio Exam 5
Updated 803d ago
flashcards Flashcards (321)
Genetics
Updated 1045d ago
flashcards Flashcards (23)
Set 1 (Fall Comp 1)
Updated 905d ago
flashcards Flashcards (25)
B1.1 Lipids
Updated 868d ago
flashcards Flashcards (32)
Ekologija
Updated 445d ago
flashcards Flashcards (104)
MGMT 105 Final
Updated 1173d ago
flashcards Flashcards (228)
Microbio Exam 5
Updated 803d ago
flashcards Flashcards (321)
Genetics
Updated 1045d ago
flashcards Flashcards (23)