Comprog Final

studied byStudied by 0 people
0.0(0)
Get a hint
Hint

Arrays

1 / 30

31 Terms

1

Arrays

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

New cards
2

Zero

In C++, an array index starts with

New cards
3

compile time

The size of an array is determined at

New cards
4

one-dimensional array

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

New cards
5

double type

is an example of a simple data type

New cards
6

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.

New cards
7

One Dimensional Array

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

New cards
8

Array

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

New cards
9

Subscript

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

New cards
10

square brackets '[]’

used to declare arrays and to access elements of an array

New cards
11

arrayName [subscript] = expression;

Syntax for assigning data to an array is

New cards
12

int num1[6] = {9};

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

New cards
13

datatype arrayName [NumberOfElements] = {value};

The syntax in declaring and initializing the 1D array is

New cards
14

Functions

Every recursive function must have one or more base cases.

New cards
15

Recursion.

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

New cards
16

Pointers

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

New cards
17

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.

New cards
18

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.

New cards
19

function

cannot return a value of type array.

New cards
20

void

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

New cards
21

local variables

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

New cards
22

void displayName();

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

New cards
23

void function

does not return a value after completing its assigned task

New cards
24

void function

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

New cards
25

void function

header begins with the keyword void.

New cards
26

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. -

New cards
27

void functionName (parameters) {}

Syntax for void function

New cards
28

struct

is a collection of a fixed number of components.

New cards
29

Struct

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

New cards
30

Scalar Variable

_____________ is unrelated to any other variable in memory.

New cards
31

Return

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

New cards

Explore top notes

note Note
studied byStudied by 5 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 24 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 9 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 10 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 2 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 16 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 52 people
Updated ... ago
5.0 Stars(1)

Explore top flashcards

flashcards Flashcard32 terms
studied byStudied by 2 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard94 terms
studied byStudied by 19 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard22 terms
studied byStudied by 5 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard27 terms
studied byStudied by 37 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard98 terms
studied byStudied by 24 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard217 terms
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard55 terms
studied byStudied by 3 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard34 terms
studied byStudied by 716 people
Updated ... ago
4.5 Stars(15)