Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

3. Is IBMs program really a mentoring program? Why or why not?

Answered: 1 week ago