Question
A Movie fan keeps track of their favorite movies by tracking their title (single field of type string), the year released (int), and the number
A Movie fan keeps track of their favorite movies by tracking their title (single field of type string), the year released (int), and the number of times they have watched the movie (int). The name of the class is Movie.
Write a Movie class (both definition (.h file) and implementation (.cpp file)) that will allow you to work with one of these movies. The methods in the movie class must include only
-
default constructor (simply initializes the number fields to zero or empty)
-
public mutator method to modify the year released (given a new value),
-
public mutator method to increment the number of times the movie was watched by one,
-
public accessor method that returns the movie title.
-
public accessor method that returns the movies year released.
-
public accessor method that returns the number of times the movie was watched.
a) Write code statement or statements like they would appear in main to declare an array (any size you like) of these Movies.
b) Again in main, assuming the data in the array has been initialized in some fashion, write the code fragment that will modify the year one of these Movies has been released. (choose any movie you like and modify to any new release year). Declare any variables you use (other than the array of class objects that you declared in part 6a).
c) Imagine that the movie fan is quarantined because of COVID-19 and has time to watch ALL the movies in their collection. In main, assuming the data in the array has been initialized in some fashion; write the code fragment that will increment ALL the movies number of times viewed in the array by one. Declare any variables you use (other than the array of class objects that you declared in part 6a).
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