Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following class declaration: class Student { public: int * grades; Student (int n) { // dynamically allocate an Student() { // delete the

image text in transcribed
image text in transcribed
image text in transcribed
Consider the following class declaration: class Student { public: int * grades; Student (int n) { // dynamically allocate an Student() { // delete the array of grades) Consider also the following statements: Student * 31 new Student (); Student * s2 = new Student (81); Select one or more: O a. s1 and s2 point at the same Student object b. Deleting s1 also deletes s2. O c. Changing s1.grades[0] changes also s2.grades[0]. O d. Int a 10A of Consider the following class declaration: dynamically allocate an array of grades of size n } ete the array of grades } Consider also the following statements: Student * 31 = new Student (); Student * s2 = new Student (s1); Select one or more: a. s1 and s2 point at the same Student object b. Deleting s1 also deletes s2. c. Changing s1.grades[0] changes also s2.grades[0]. d. Int a 101 Consider also the following statements: Student * 31 = new Student (); Student * 32 = new Student (51); Select one or more: a. s1 and s2 point at the same Student object b. Deleting s1 also deletes s2. c. Changing s1.grades[0] changes also s2.grades[0]. od. Int a[10]; s1.grades = a; The above statement makes both s1.grades and s2.grades point at a. O e. Deleting s1 deletes the array pointed at by s2.grades

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

Students also viewed these Databases questions