Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ITC 112 - Topic 4 Quiz

Total questions: 55

Worksheet time: 28mins

Name
Class
Date
1.

A programmer writes a short declaration before main() to inform the compiler about a function’s name, return type, and parameters.

a)

Function Prototype

b)

Function Call

c)

Function Definition

2.

The program jumps to another section after encountering a statement like displayMenu();.

a)

Function Prototype

b)

Function Call

c)

Function Definition

3.

A student is writing the complete function—return type, name, parameters, and the block of statements enclosed in { }.

a)

Function Prototype

b)

Function Call

c)

Function Definition

4.

The compiler reads a line of code with no executable instructions, only the function’s structure.

a)

Function Prototype

b)

Function Call

c)

Function Definition

5.

The programmer wants to trigger the execution of a function multiple times throughout the program.

a)

Function Prototype

b)

Function Call

c)

Function Definition

6.

The instructor asks, “Where do you place the full set of instructions that the function will perform?”

a)

Function Prototype

b)

Function Call

c)

Function Definition

7.

The developer includes a statement before main() so the compiler recognizes the function despite the full version appearing later in the program.

a)

Function Prototype

b)

Function Call

c)

Function Definition

8.

A line in main() instructs the program to jump to a previously written function and return afterward.

a)

Function Prototype

b)

Function Call

c)

Function Definition

9.

A programmer starts writing the return type, name, parameters, and all logic needed to perform a specific task.

a)

Function Prototype

b)

Function Call

c)

Function Definition

10.

A programmer creates a routine that updates a record on the screen but the rest of the program does not need any value from it afterward.

a)

Void Function

b)

Value Returning Function

11.

A student designs a function that computes the average of three scores so it can be used later in several conditions within main().

a)

Void Function

b)

Value Returning Function

12.

A function is written to show a formatted heading every time a menu appears.

a)

Void Function

b)

Value Returning Function

13.

Another function is responsible for determining whether a discount should apply, and its result must be stored in a variable.

a)

Void Function

b)

Value Returning Function

14.

A programmer writes a task that prints error messages when user input is invalid.

a)

Void Function

b)

Value Returning Function

15.

A function is required to supply a computed tax amount to be used in a final bill summary.

a)

Void Function

b)

Value Returning Function

16.

During debugging, the instructor asks the student why a function has no return statement even though the program still runs correctly.

a)

Void Function

b)

Value Returning Function

17.

A function evaluates a condition and sends back a numerical score that determines the program’s next step.

a)

Void Function

b)

Value Returning Function

18.

A student wants to label a function in a way that clearly describes what task it performs before calling it elsewhere in the program.

a)

Function Name

b)

Return Type

c)

Parameters

d)

Arguments

e)

Function Body

19.

A programmer is fixing an error after the compiler warns that a function is processing the wrong kind of value compared to what the program expects.

a)

Function Name

b)

Return Type

c)

Parameters

d)

Arguments

e)

Function Body

20.

While writing a function, a student lists several placeholders inside the parentheses so the function can work with various incoming values.

a)

Function Name

b)

Return Type

c)

Parameters

d)

Arguments

e)

Function Body

21.

The programmer calls a function and supplies the actual data that will be passed inside for processing.

a)

Function Name

b)

Return Type

c)

Parameters

d)

Arguments

e)

Function Body

22.

A student is reviewing the part of a function that contains the statements executed step-by-step once the function is triggered.

a)

Function Name

b)

Return Type

c)

Parameters

d)

Arguments

e)

Function Body

23.

The team is updating the identifier used when referring to a function because its label doesn’t match what the function actually does.

a)

Function Name

b)

Return Type

c)

Parameters

d)

Arguments

e)

Function Body

24.

A programmer checks the declared type at the start of a function to ensure the value it produces is compatible with how it's used elsewhere.

a)

Function Name

b)

Return Type

c)

Parameters

d)

Arguments

e)

Function Body

25.

A student is debugging the internal instructions inside the curly braces because the function isn’t producing the expected results.

a)

Function Name

b)

Return Type

c)

Parameters

d)

Arguments

e)

Function Body

26.

Inside main(), a student types in the specific values that will be sent into a function to replace its placeholders during execution.

a)

Function Name

b)

Return Type

c)

Parameters

d)

Arguments

e)

Function Body

27.

A programmer wants to modify the statements inside a function definition.

a)

Function Name

b)

Return Type

c)

Parameters

d)

Arguments

e)

Function Body

28.

A student calls a function inside main(), but the compiler reports it has no prior knowledge of the function even though its full definition appears later in the file.

a)

Missing Prototype

b)

Mismatched Return Type

c)

Parameter–Argument Mismatch

d)

Missing Return Statement

e)

Duplicate Function Names

29.

The instructor explains that the compiler reads the code from top to bottom, so a function used early must be introduced before it’s called.

a)

Missing Prototype

b)

Mismatched Return Type

c)

Parameter–Argument Mismatch

d)

Missing Return Statement

e)

Duplicate Function Names

30.

A function is declared to return an int, but the student accidentally writes a statement that sends back a decimal value.

a)

Missing Prototype

b)

Mismatched Return Type

c)

Parameter–Argument Mismatch

d)

Missing Return Statement

e)

Duplicate Function Names

31.

The compiler warns that the function’s data type does not match what the function promised in its declaration, causing unpredictable output.

a)

Missing Prototype

b)

Mismatched Return Type

c)

Parameter–Argument Mismatch

d)

Missing Return Statement

e)

Duplicate Function Names

32.

A programmer calls a function using three variables, but the function itself only expects two, causing an error about incompatible function calls.

a)

Missing Prototype

b)

Mismatched Return Type

c)

Parameter–Argument Mismatch

d)

Missing Return Statement

e)

Duplicate Function Names

33.

A student mixes the order of values passed into a function, causing incorrect results because the function’s temporary variable list doesn’t match.

a)

Missing Prototype

b)

Mismatched Return Type

c)

Parameter–Argument Mismatch

d)

Missing Return Statement

e)

Duplicate Function Names

34.

The function header states it will send back a numeric result, but the body contains no statement that provides any value to the caller.

a)

Missing Prototype

b)

Mismatched Return Type

c)

Parameter–Argument Mismatch

d)

Missing Return Statement

e)

Duplicate Function Names

35.

The programmer forgets to include a value at the end of a computation, leading to undefined behavior because the function promised to give back something.

a)

Missing Prototype

b)

Mismatched Return Type

c)

Parameter–Argument Mismatch

d)

Missing Return Statement

e)

Duplicate Function Names

36.

A student accidentally writes two functions with the exact same description and identical parameter lists, confusing the compiler about which one to used.

a)

Missing Prototype

b)

Mismatched Return Type

c)

Parameter–Argument Mismatch

d)

Missing Return Statement

e)

Duplicate Function Names

37.

When compiling, the system reports ambiguity because two separate functions share the same function call making them indistinguishable.

a)

Missing Prototype

b)

Mismatched Return Type

c)

Parameter–Argument Mismatch

d)

Missing Return Statement

e)

Duplicate Function Names

38.

The program has just begun running and is reading the first statements written by the programmer.

a)

Program starts in main()

b)

Function Call

c)

Jump to Function Definition

d)

Execute Function Instructions

e)

Return to main()

39.

Inside main(), the program encounters a line that instructs it to perform another task located elsewhere in the code.

a)

Program starts in main()

b)

Function Call

c)

Jump to Function Definition

d)

Execute Function Instructions

e)

Return to main()

40.

After encountering a function name, the program moves away from main() and transfers control to where the function is fully written.

a)

Program starts in main()

b)

Function Call

c)

Jump to Function Definition

d)

Execute Function Instructions

e)

Return to main()

41.

The CPU is now inside the function and is processing each statement inside its braces sequentially.

a)

Program starts in main()

b)

Function Call

c)

Jump to Function Definition

d)

Execute Function Instructions

e)

Return to main()

42.

The function has finished all of its steps and control moves back to the exact point after the call was made.

a)

Program starts in main()

b)

Function Call

c)

Jump to Function Definition

d)

Execute Function Instructions

e)

Return to main()

43.

Before any function runs, the program must begin executing the initial block of statements that guide the entire flow.

a)

Program starts in main()

b)

Function Call

c)

Jump to Function Definition

d)

Execute Function Instructions

e)

Return to main()

44.

A line inside main() requests help from a separate section of the code — the program temporarily leaves main() at this moment.

a)

Program starts in main()

b)

Function Call

c)

Jump to Function Definition

d)

Execute Function Instructions

e)

Return to main()

45.

The program diverts its path and relocates execution to a lower part of the file where the function’s instructions are written.

a)

Program starts in main()

b)

Function Call

c)

Jump to Function Definition

d)

Execute Function Instructions

e)

Return to main()

46.

All the real logic of the function — calculations, display statements, and processing — is happening at this stage.

a)

Program starts in main()

b)

Function Call

c)

Jump to Function Definition

d)

Execute Function Instructions

e)

Return to main()

47.

After performing a specific task, the function hands back control so that the rest of the statements in main() can continue.

a)

Program starts in main()

b)

Function Call

c)

Jump to Function Definition

d)

Execute Function Instructions

e)

Return to main()

48.

A student names a function x1() but the instructor cannot guess what the function does just by looking at its description.

a)

Use Meaningful Names

b)

One Function = One Purpose

c)

Keep Functions Short and Readable

d)

Use Comments Wisely

49.

The programmer renames a function from doTask() to computeGradeAverage() to make the code clearer for future readers.

a)

Use Meaningful Names

b)

One Function = One Purpose

c)

Keep Functions Short and Readable

d)

Use Comments Wisely

50.

A student writes a function that calculates totals and prints menus and validates inputs, causing confusion about what the function is actually responsible for.

a)

Use Meaningful Names

b)

One Function = One Purpose

c)

Keep Functions Short and Readable

d)

Use Comments Wisely

51.

During code review, the instructor suggests splitting a multi-task function into several smaller ones that each handle only one job.

a)

Use Meaningful Names

b)

One Function = One Purpose

c)

Keep Functions Short and Readable

d)

Use Comments Wisely

52.

A programmer notices that a function is over 40 lines long and contains nested logic, making it difficult to track errors.

a)

Use Meaningful Names

b)

One Function = One Purpose

c)

Keep Functions Short and Readable

d)

Use Comments Wisely

53.

The instructor recommends breaking a large function into smaller sections so its structure becomes easier to understand and maintain.

a)

Use Meaningful Names

b)

One Function = One Purpose

c)

Keep Functions Short and Readable

d)

Use Comments Wisely

54.

A student places long explanations before every line of code, causing clutter instead of clarity.

a)

Use Meaningful Names

b)

One Function = One Purpose

c)

Keep Functions Short and Readable

d)

Use Comments Wisely

55.

The programmer adds a short description above a function to explain its purpose without overloading the code with unnecessary text.

a)

Use Meaningful Names

b)

One Function = One Purpose

c)

Keep Functions Short and Readable

d)

Use Comments Wisely