Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started