CSI FINAL

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

1/128

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

129 Terms

1
New cards

Algorithm

a sequence of instructions that solves a problem

2
New cards

string literal

Text in double quotes “ “ is called?

3
New cards

newline character

\n

4
New cards

//

single line comment begins with?

5
New cards

/* */

multi-line comment starts and ends with?

6
New cards

generates an error

what does the following code output? (if an error is generated, say “generates an error”)

/*

x = 5; /* comment here */

y = 6;

*/

cout « x « y;

7
New cards

syntax error

what kind of error is it when you violate a programming language’s rules on creating a program?

8
New cards

logic error

error that occurs while a program runs; program compiles but doesn’t run as intended

9
New cards

warning

compiler sometimes can report a ______, which indicates a possible logic error, but doesn’t actually stop the compiler from generating a program

10
New cards

memory

a circuit that can store 0s and 1s in a series of thousands of addressed locations

11
New cards

machine instructions

instructions represented as 0s and 1s

12
New cards

executable program

a sequence of machine instructions together form a(n)

13
New cards

assembly language instructions

used with assemblers to automatically translate human readable instructions into machine instructions

14
New cards

high-level languages

created to support programming using formulas/algorithms, more closely related to human thinking

15
New cards

compilers

programs that automatically translate high-level languages programs into executable programs

16
New cards

C

Which language is C++ derived from?

17
New cards

allocation

the process of determining a suitable memory location to store data like variables

18
New cards

character literal

surrounded in single quotes ‘ ‘

19
New cards

10, 15

What range of numbers am I generating from? ___ to ___

(rand() % 6) + 10

20
New cards

branch

a sequence of statements only executed under a certain condition

21
New cards

Precedence Rules

() → ! → Arithmetic Operators → Relational Operators → Equality/Inequality Operators → && → ||

** pay attention to this order! Don’t just breeze through with the name :)

22
New cards

c

What does the following return?

firstName = “Jacob”

cout « firstName.at(2)

23
New cards

push_back()

function that adds a character to the end of a string, or an element to the end of a vector

24
New cards

append()

function that adds one string to the end of another (string that goes on the end goes in the parentheses)

25
New cards

isalpha()

character function that returns true if alphabetic

26
New cards

isdigit()

character function that returns true if digit

27
New cards

isspace()

character function that returns true if whitespace

28
New cards

toupper()

character function that changes the selected character to the uppercase version

29
New cards

tolower()

character function that changes the selected character to the lowercase version of the letter

30
New cards

conditional expression

condition ? exprWhenTrue : exprWhenFalse

31
New cards

short circuit evaluation

skips evaluating later operands if the result of the logical operator can already be determined

32
New cards

break

statement that, in a loop, causes the immediate exit of a loop

33
New cards

continue

statement that, in a loop, causes the immediate jump to the loop condition check

34
New cards

enumeration type

declares a name for a new type and possible values of that type

eg: enum color {red, green, yellow};

35
New cards

top level domain

the last part of an internet domain name (like .com)

36
New cards

resize()

vector function that can be called to change the size of a vector

37
New cards

end

when resize() is called and the new size is larger than the old, elements are added to the ___ of the vector

38
New cards

end

when resize() is called and the new size is smaller than the old, elements at the ___ of the vector are deleted

39
New cards

back()

vector function that returns last element of a vector

40
New cards

pop_back()

vector function that removes the last element of a vector

41
New cards

size, equal

vectorA == vectorB returns true if the vectors are the same _____ and each element pair is _____

42
New cards

null character

strings in a char array must end with a _____ ________

43
New cards

strcpy()

copies sourceStr (include null char) to destStr. destStr must have enough space for sourceStr, including the null character

44
New cards

strncpy()

copies up to numChars characters from sourceStr. destStr must have enough space for the copied characters, including the null character.

45
New cards

strcat()

copies sourceStr to the end of destStr (starting at \0), then appends a null char. destStr needs enough space for all of sourceStr and the null char

46
New cards

strncat()

copies up to numChars characters from sourceStr to end of destStr, then appends a null char

47
New cards

strchr()

return NULL if searchChar doesn’t exist in sourceStr. Else, it returns the address of the first occurrence

48
New cards

strlen()

returns number of characters in sourceStr, not including the null char

49
New cards

strcmp()

returns 0 if str1 and str2 are equal, nonzero if they differ

50
New cards

str2

given strcmp(str1,str2), if a negative number is returned, which string is greater

51
New cards

str1

given strcmp(str1,str2), if a positive number is returned, which string is greater

52
New cards

isalnum()

returns true if char is alphabetic or numeric digit

53
New cards

islower()

returns true if char is lowercase

54
New cards

isupper()

returns true if char is uppercase

55
New cards

isblank()

returns true if char is blank character (includes spaces/tabs)

56
New cards

isxdigit()

returns true if char is hexadecimal digit (0-9, a-f, A-F)

57
New cards

ispunct()

returns true if char is punctuation char

58
New cards

isprint()

returns true if char is printable character (includes alphanumeric, punctuation, spaces)

59
New cards

iscntrl()

returns true if char is control char (all non-printable characters)

60
New cards

function

a grouping of predefined statements for repeatedly used operations

61
New cards

function definition

consists of the new function’s name and a block of statements

62
New cards

function call

an invocation of a function’s name, causing the function’s statements to execute

63
New cards

void

which return type indicates a function does not return any value?

64
New cards

parameter

a function input specified in a function definition

65
New cards

diameter

what is the parameter of this function?

double calcArea(double diameter) {…}

66
New cards

argument

a value provided to a function’s parameter during a function call

67
New cards

12.0

what is the argument used in this function/function call?

double calcArea(double diameter) {…}

int main() {

cout « “area is “ « calcArea(12.0) « endl;

68
New cards

modular development

the process of dividing a program into separate modules that can be developed and tested separately and then integrated into a single program

69
New cards

incremental development

the process in which a programmer writes, compiles, and tests a small amount of code, then writes/compiles/tests a small amount more, and so on.

70
New cards

function stub

a function definition whose statements have not yet been written

71
New cards

unit testing

the process of individually testing a small part/unit of a program (typically a function)

72
New cards

testbench

a separate program whose sole purpose is to check that a function returns correct output values for a variety of input values.

73
New cards

test vector

each unique set of input values in a testbench

74
New cards

local

each function call creates a new set of ______ variables

75
New cards

discarded

each return of a function causes its local variables to be ______

76
New cards

pass by value

normal parameters are _____ ___ _______, meaning the arguments value is COPIED into a local variable for the parameter

77
New cards

pass by reference

this type of parameter does NOT create a local copy of the argument, but rather, refers directly to the argument variable’s memory location

78
New cards

&

appending what symbol to a parameter’s data type makes it pass-by-reference?

79
New cards

reference

a variable type that refers to another variable

80
New cards

const

what keyword can be prepended to a function’s parameter to prevent the function from modifying it?

81
New cards

global variable

a variable declared outside any function (should be used sparingly)

82
New cards

function declaration

specifies the function’s return type/name/parameters, ending with a semicolon where the opening brace would’ve gone

83
New cards

default parameter value

when a function contains this, a function call can omit the last argument(s) and the program uses a default value instead.

84
New cards

end

default parameter values for a function should come at the ___ of a function definition

85
New cards

B

which of these is an invalid use of a function that includes default parameter values?

A : void PrintDate(int currDay, int currMonth = 1, int currYear = 2025, int printStyle = 0);

B : void PrintDate(int currDay = 10, int currMonth, int currYear = 2025, int printStyle = 0);

C : void PrintDate (int currDay, int currMonth, int currYear, int printStyle = 0);

86
New cards

function overloading

when a program has multiple functions with the same name but differing in number/types of parameters

87
New cards

distinct

function overloading is allowed as long as each has _____ parameter types

88
New cards

preprocessor

a tool that scans the file from top to bottom, looking for any lines that begin with #

89
New cards

preprocessor directive

a line that directs the preprocessor to modify the file in some way before the compilation continues

90
New cards

object

a grouping of data and operations that can be performed on that data

91
New cards

abstraction

means to have a user interact with an item at a high-level, with lower level internal details hidden from the usera

92
New cards

abstraction data type

a data type whose creation and update are constrained to specific, well-defined operations

93
New cards

class

construct that defines a new type that can group data/functions to form an object

94
New cards

public member functions

a class’ ____ _______ _______ indicate all operations a class user can perform on an object

95
New cards

implemented, behaves

a class user does not need to know how a class’ data and functions are ________, but only need to understand how each public member function _______.

96
New cards

member access operator

“.”, used to invoke a function on an object

97
New cards

private data members

variables that member functions of a class can access, but class users cannot

98
New cards

scope resolution operator

each member function has the class name and ::, known as the _____ _______ ________, preceding the function’s name.

99
New cards

inline member function

when a member function’s definition appears within the class definition, it is known as an ______ ______ ______

100
New cards

setter

this type of function can modify a class’ data members (aka mutator function)