Comprog Final

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/30

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

31 Terms

1
New cards

Arrays

can be passed as parameters to a function either by value or by reference.

2
New cards

Zero

In C++, an array index starts with

3
New cards

compile time

The size of an array is determined at

4
New cards

one-dimensional array

A ———————————— is an example of a primitive or built-in data type, not a structured data type.

5
New cards

double type

is an example of a simple data type

6
New cards

not ignore

When declaring a one-dimensional array as a formal parameter, you usually omit the array size. If you specify the size of a one-dimensional array in the formal parameter declaration, the compiler will ____________ the size.

7
New cards

One Dimensional Array

is an array in which the components are arranged in a list form

8
New cards

Array

is a collection of a fixed number of components all of the same data type.

9
New cards

Subscript

indicates the variable’s position in the array and is assigned by the computer when the array is created in internal memory.

10
New cards

square brackets '[]’

used to declare arrays and to access elements of an array

11
New cards

arrayName [subscript] = expression;

Syntax for assigning data to an array is

12
New cards

int num1[6] = {9};

To declare and initialize a six-element integer array name num1 initialized to 9

13
New cards

datatype arrayName [NumberOfElements] = {value};

The syntax in declaring and initializing the 1D array is

14
New cards

Functions

Every recursive function must have one or more base cases.

15
New cards

Recursion.

The process of solving a problem by reducing it to smaller versions of itself is called

16
New cards

Pointers

are a special type of variable that contains memory address as their value.

17
New cards

function

prototype is a declaration of the function that tells the program about the type of the value returned by the function and the number and type of arguments.

18
New cards

function

block of code that performs specific tasks. It is used to divide a problem into smaller parts to make a program easy to understand.

19
New cards

function

cannot return a value of type array.

20
New cards

void

In C++, the function header for a function that does not return a value begins with the keyword

21
New cards

local variables

Variables that can be used only by the function in which they are declared are called?

22
New cards

void displayName();

The correct function prototype for a void function that requires no formal parameters? The function’s name is displayName.

23
New cards

void function

does not return a value after completing its assigned task

24
New cards

void function

call typically appears as its statement in a C++ program.

25
New cards

void function

header begins with the keyword void.

26
New cards

displayTaxes(federalTax, localTax);

C++ statement that calls a void function named displayTaxes, passing it a copy of the contents of two double variables named federalTax and localTax. -

27
New cards

void functionName (parameters) {}

Syntax for void function

28
New cards

struct

is a collection of a fixed number of components.

29
New cards

Struct

not a reserved word, it is a keyword in C++

30
New cards

Scalar Variable

_____________ is unrelated to any other variable in memory.

31
New cards

Return

statement typically is not the last statement in a C++ void function