Question: Using C++ Define a class named Movie that has the following private variables: title (string) rating (float) genre (string) runtime (int) year (int) actors (a
Using C++
Define a class named Movie that has the following private variables:
title (string) rating (float) genre (string) runtime (int) year (int) actors (a pointer to a dynamic array of actor names as strings)
The class will have the following public functions:
accessor and mutator functions for private variables addActor (adds a new actor to the dynamic array of actors, provided the actor isn't already in the array. Returns true if the actor is added, and false if the actor is already present) removeActor (removes an actor from the dynamic array; returns true if the actor is removed, and false if the actor is not present in the array) a member function for overloading the == operator, which returns true if the movies have the same title and year a friend function to overload the < operator, which returns true if movie1 has a lower rating than movie2 a friend function to overload the > operator, which returns true if movie1 has a higher rating than movie2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
