CSC102 Chapter 9 Quiz with Complete Solutions
CSC102 Chapter 9 Quiz with Complete Solutions A function can return a value of the type array. - Answer-False A function can return a value of the type struct. - Answer-True A list has two items associated with it: . - Answer-the values and the length A struct is typically a data structure. - Answer-heterogeneous A struct variable can be passed as a parameter . - Answer-either by value or by reference Aggregate input/output operations are allowed on a struct variable. - Answer-False An array name and index are separated using . - Answer-square brackets Consider the following function prototype: int seqSearch(const listType& list, int searchItem); The actual parameter cannot be modified by . a. list b. seqSearch c. searchItem d. listType - Answer-list Consider the following statements. struct circleData { double radius; double area; double circumference; }; circleData circle; Which of the following statements is valid in C++? a. cin s; = 3.14 * s * radius; b. cin s; c. cin s; = 3.14 * radius * radius; d. cin circle; - Answer-cin s; 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;
Información del documento
- Subido en
- 13 de abril de 2024
- Número de páginas
- 10
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas