Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Look at the following statement. bookList[2].publisher[3] = \'t\'; This statemen

ID: 3688208 • Letter: L

Question

Look at the following statement. bookList[2].publisher[3] = 't'; This statement. A) is illegal in C++ B) will change the publisher's name of the second book in bookList to ' t' C) will store the character 't' in tho fourth element of the publisher member of booklist [2] D) will ultimately result in a runtime error E) None of these 22) Passing a structure as a constant reference parameter to a function A) can potentially result in changes to the structure's members B) guarantees not to result in changes to the structure's members c) will always change the structure's members D) All of these E) None of these

Explanation / Answer

Q21.

bookList[2].publisher[3]=''t';

according to given statement It is valid statement in any language specially object oriented language.

we can assume that here bookList is list of objects where each object represent one book,

bookList[2] gives you a book at index 2 and publisher is char array which denote name of publisher.

so bookList[2].publisher[3] denotes 4th character in publisher name of 3rd book.

bookList[2].publisher[3]=''t';--> So are assiging 't' to fourth character of publisher name to that particular book

So option C os correct

Q22.

Passing a structure as a constant reference parameter to a function guarantees not to result in changes to the structure's members.

because we passing like const <struct>& and when we pass something by value or by const reference , It is illegal to change the original content. Function can not make changes in Original value using these two ways of passing parameters.

So option B is correct

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote