1/84
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress

In this declaration, Rock is
a tag
What allows you to access structure members
dot operator

Given the structure declaration, which is the correct way to define an array named carLot of 20 Car variables?
Car carLot[20];
Which of the following assigns a value to the hourlyWage member of the third element in a structure array called employee?
employee[2].hourlyWage = 100.00;

Given the structure declaration and given that there is a 20-element Car array named carLot that has already been defined in the main function, assign 14299 to the bluebookPrice member of the first element in the carLot array
carLot[0].price.bluebookPrice = 14299;
a function _____ returns a structure
may

In this declaration, hardnessScale is
a member
given the structure and assume a pointer variable to a Rectangle has already been created named myRectangle and it points to a dynamically allocated Rectangle array. At the end of the program, how would you release the allocated memory.
delete [] myRectangle;

Given the structure declaration, which is the correct way to create a pointer variable to a Rectangle named myRectangle
Rectangle* myRectangle;

given the structure declaration, what is the Tag of the structure
Dog
Data types that are created by the programmer are known as ___
abstract data types

given the structure declaration, what are the variables definitions called inside the curly braces (dogName, breed, dogAge, and fixed)
members

what is the correct syntax for dynamically allocating a Student array of 100 elements where Student is a structure
Student* stuArray = new Student[100];
a structure ____ contain members of differing data types
can

given the structure declaration and assume a pointer variable to a Rectangle has already been created name myRectangle. Would dynamically allocate an array of 100 Rectangle variables and use myRectangle to point to it
myRectangle = new Rectangle[100];

Which of the following statements outputs the value of the gpa member of the 2nd element of the student array given that Student structure has been declared in the source file
cout « student[1].gpa;

given the structure declaration and given that there is a 20-element Car array named carLot that has already been defined in the main function, what is the correct way to assign 2004 to the yearModel member of the first element in carLot
carLot[0].yearModel = 2004;
a pointer variable is designed to store
a memory address

what will the following program segment output
41

what is the output of the following code segment:
2 6 6

what is the output of the following program
I=5, j=10
which of the following statements deletes memory that has been dynamically allocated for an array of 100 string elements named addresses
delete [] adresses;

given the code segment below, what is the output of the program
6

which code correctly calls the following function
float* nums; / nuts = createArray(9);

should we use the delete operator on this array
no

what will the following code output
the memory address of the strPtr variable
if you are going to dynamically allocate an array where each element is a pointer to a double, which is the correct way to define the pointer to this array
double** scores

what will the following code output
22
the ____ , also known as the dress operator, returns the memory address of a variable
ampersand (&)

what will the following statement output
the memory address of the variable called num1

what is the out of the following program segment
50

given the variable definition below, define a pointer variable named ptr and assign the memory address of num to the pointer variable
int*ptr = #

what is the output of the following code segment
4 8
the ____, also known as the dereference or indirection operator, returns the value of the variable or array element that the pointer is pointing to
asterisk (*)

what does the following statement do
declares a pointer variable named numPtr
which of the following statements deletes memory that has been dynamically allocated for an array
delete [] arrayName;
the individual values contained in an array are called _______
elements
to access an array element, use the array name and the element’s
index
array indexes begin with the number ____
0
an array can store a group of values, but the values must be the same ______
data type
valid C++ array definitions
int myNums[10];
a _____ is best to use in order to traverse through each element of an array
for loop

the following programming statement shows an example of ______
implicit array sizing

how many elements does the following array have
5000

what is the last legal index/subscript that can be used with the following array
17
the name of an array stores the ____ of the first array element
memory address
a two-dimensional array can be viewed as ____ and ____
rows, columns
to assign the contents of one integer array to another integer array of the same size you must use _____
a loop to assign the elements of one array to the other array one element at a time

given the following declaration, where is 97 stored in the scores array
scores[4]
an array of string objects that will hold 5 names would be declared using which statement
string names[5];

what will the the following code segment display
11 13 17 6 19

given the program segment, write the missing programming statement that will read in a string containing spaces from the user, which should be placed in the character array named trait
cin.getline(trait,50);
what should you use to store different types of related information on dogs. For example, you want to store multiple dog names and also store those dog’s ages
parallel arrays

what will the following code segment display to the screen
16

the following is a complete C++ program/ what will this program display. to the screen when it runs
6

what would the following code segment display to the screen
34
to pass an array as an argument to a function, pass only the ____ of the array into the function call
name

what will the following code segment display to the screen
11

write the programming statement that correctly prints the second element of the vector defined below
cout « clocks.at(1);
you must #include <_____> to create and use a vector in your program
vector
data parallelism is where ____ is performed over ____ across multiple processors
the same task, different pieces of data
task parallelism is where ____ across multiple processors
different tasks are performed simultaneously
to allow file access in a program, you must #include the ____ header file
#include <fstream>
assuming outFile is a file object variable and temp is a double variable, which statement writes the contents of temp to the file associated with outFile
outFile « temp;
which of the following is correct to open a file assuming inFile is the file stream object variable
inFile.open(“filename.txt”);
read from a file assuming that inFile is a file stream object variable and content is a string variable
get line(inFile, content);
inFile.read(“content”);
inFile « content;
inFile » content;
get line(content,inFile);
correctly opens a file with file stream object variable name outFile in append mode
outFile.open(“myFile.txt”,ios::app);
which of the following bits associated with an input/output stream will be true if all other bits are false
goodbit

the text file data.txt. contains data delimited by the ‘$’. what should be the test expression (condition) inside the while loop in the code segment below in order to read from the file
getline(inFileminput,’$’);
a(n) ____ is information that is passed to a function, and a(n) ___ is information that is received by a function
argument, parameter

given this function prototype, what would be a vlid function call statement to this function
calcArea(3.5,2.4);
a function can have zero to many parameters and it can return this many values(using the return statement)
only one

what is the output of the following program
3 7 3

what will the following program output
2 4 0 8 2 4

what is the output of the following program
2 0 0

what is the output of the following program
7

which letter corresponds to the function header
A

which letter corresponds to the function prototypes
B

which letter corresponds to the function call statement
C

which letter corresponds to the function body
D

which letter corresponds to the return type
A

which letter corresponds to the parameter list
B

which letter corresponds to the function name
C

which letter corresponds to the return statement
D