What are the four fundamental data types?
int
float
char
bool
What type of variable is declared with the intention that its value will not change throughout the execution of the program?
a const variable
What does IDE stand for?
Integrated Development Environment
What does the "break;" statement in a switch-case statement do?
exits the entire switch block
What is a function?
a named sequence of statements
a named block of code that performs a specific task
How do you declare and initialize a boolean a value of "true"?
bool myBool = true;
How do you declare an array of nine integers?
int myArray[9];
What is an essential and iterative process in software development that involves identifying, isolating, and resolving errors?
debugging
In the context of a switch-case statement, what does "fall-through" refer to?
fall-through refers to when control flows from one case to the next without an intervening break statement
What are the four components of a function definition?
return type
function name
parameter list
function body
What are two user-defined data types?
string
array
struct
How do you initialize an array of nine integers?
myArray[9] = {1,2,3,4,5,6,7,8,9};
semantic errors
Name two reasons to use a switch-case over a if-else chain?
efficiency
readability
semantic clarity
built-in default case
What return type is used for a function that returns no value?
void
What is scope?
scope refers to the range of code over which a variable or function is valid
What is a struct?
A struct is a user-defined data type that groups together variables of different data types under a single name
In an IDE's integrated debugger tool, what does a breakpoint do?
pauses code execution
How do you assign the value of "mint chip" to the 4th element of this array:
string flavors[4] = {"vanilla", "chocolate", "strawberry", "rocky road"}
Functions involve simplifying complex collections of commands allowing you to organize program instructions and more effectively at a higher lever while hiding lower level details, which is a great example of what general concept?
abstraction
What type of variable is accessible and retains its value throughout the entire program, including all functions and code blocks?
a global variable
Structs involve simplifying complex collections of data allowing you to organize information more effectively at a higher level while hiding low-level details, which is a great example of what general concept?
abstraction
What is a library?
a pre-made collection of functions and tools that can be imported into your code
How do you assign each element of an array of 900 booleans to be "true" using a for loop?
for (int i = 0; i < 900; i++) {
myArray[i] = true;
}
What is the scope of a variable that is declared in the parameter list of a function?
it's scope is limited to that function