Exam 9: Records (structs)
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Input/Output50 Questions
Exam 4: Control Structures I (Selection)50 Questions
Exam 5: Control Structures II (Repetition)50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the string Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records (structs)50 Questions
Exam 10: Classes and Data Abstraction50 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Linked Lists50 Questions
Exam 17: Stacks and Queues50 Questions
Exam 18: Searching and Sorting Algorithms50 Questions
Exam 19: Binary Trees50 Questions
Exam 20: Graphs50 Questions
Exam 21: Standard Template Library (STL)50 Questions
Select questions type
Consider the following statements: struct personalInfo
{
string name;
int age;
double height;
double weight;
};
struct commonInfo
{
string name;
int age;
};
personalInfo person1,person2;
commonInfo person3,person4;
Which of the following statements is valid in C++?
(Multiple Choice)
4.8/5
(38)
Consider the following statements: struct supplierType
{
string name;
int supplierID;
};
struct applianceType
{
supplierType supplier;
string modelNo;
double cost;
};
applianceType applianceList[25];
Which of the following statements correctly initializes the cost of each appliance to 0?
(Multiple Choice)
4.9/5
(25)
The following statement defines a struct houseType with a total of ____________________ member(s).
struct houseType
{
string style;
int numOfBedrooms;
int numOfBathrooms;
int numOfCarsGarage;
int yearBuilt;
};
(Short Answer)
4.8/5
(36)
Consider the following statements.
struct circleData
{
double radius;
double area;
double circumference;
};
circleData circle;
Which of the following statements is valid in C++?
(Multiple Choice)
4.9/5
(35)
Consider the following function prototype: int seqSearch(const listType& list,int searchItem);
The actual parameter cannot be modified by ____.
(Multiple Choice)
4.9/5
(38)
You can assign the value of one struct variable to another struct variable of ____ type.
(Multiple Choice)
5.0/5
(42)
The contents of a struct variable must be written one member at a time.
(True/False)
4.8/5
(41)
Which of the following struct definitions is correct in C++?
(Multiple Choice)
4.8/5
(34)
Which of the following is an allowable aggregate operation on a struct?
(Multiple Choice)
4.8/5
(45)
Figure 1:
struct newStudent
{
string firstName;
string lastName;
string courseGrade;
int testScore;
int programmingScore;
};
int score;
-Consider the accompanying struct definition in Figure 1.The statement that initializes the member firstName to Melissa is ____________________.
(Short Answer)
4.9/5
(29)
Memory is allocated for struct variables only when you ____________________ them.
(Short Answer)
4.8/5
(38)
You can use an assignment statement to copy the contents of one struct into another struct of the same type.
(True/False)
4.8/5
(36)
Consider the following struct definition:
const int ARRAY_SIZE = 1000;
struct listType
{
int listElem[ARRAY_SIZE];
int listLength;
};
The statement that declares intList to be a struct variable of type listType is ____________________.
(Short Answer)
4.8/5
(37)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)