Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume that rating_ is a private int data member of the Movie class and age_ is a private int data member of the Director class.

Assume that rating_ is a private int data member of the Movie class and age_ is a private int data member of the Director class. For each line indicate if the code is valid, has a compilation error, or runtime error. Please provide rationale for each answer. Code is in C++.

Movie Movie::Example(Movie mov_a, const Movie& mov_b, Director& dir) const { int x, rating; Movie m; this->rating_ = 10; mov_b.rating_ = rating; mov_a.rating_ = mov_b.rating_; dir.age_ = 99; rating = x + 8 + movB_rating_; m = mov_a; mov_a.rating_ = rating; dir->set_age(68); return m; }

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions