Exam 9: Records (structs)

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Consider the following statements: struct personalInfo { \quad string name; \quad int age; \quad double height; \quad double weight; }; struct commonInfo { \quad string name; \quad 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 { \quad string name; \quad int supplierID; }; struct applianceType { \quad supplierType supplier; \quad string modelNo; \quad 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)

A function can return a value of the type array.

(True/False)
4.7/5
(38)

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)

An array name and index are separated using ____.

(Multiple Choice)
4.7/5
(31)

Consider the following statements. struct circleData { \quad double radius; \quad double area; \quad 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)

Data in a struct variable must be read one member at a time.

(True/False)
4.9/5
(41)

Which of the following is an allowable aggregate operation on a struct?

(Multiple Choice)
4.8/5
(45)

A struct is a(n)____________________,not a declaration.

(Short Answer)
4.8/5
(26)

You can declare struct variables when you define a struct.

(True/False)
4.8/5
(43)

Relational operations can be used on struct variables.

(True/False)
4.7/5
(42)

A function can return a value of the type struct.

(True/False)
4.8/5
(36)

Figure 1: struct newStudent { \quad string firstName; \quad string lastName; \quad string courseGrade; \quad int testScore; \quad 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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)