Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab Homework #2: The Movie Collection Object In this homework assignment, we are going to define a Movie class and use a collection of Movie

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

image text in transcribed

image text in transcribed

Lab Homework #2: The Movie Collection Object In this homework assignment, we are going to define a Movie class and use a collection of Movie objects. By using a vector collection variable (also implemented as a class), we are going to implement a number of operations. You are given a template program file that you can extend to complete the requirements of the assignment. Basically, we are going to make use of the following class in order to keep a record of a list of Movies. We want to incorporate the Movie class to create new Movie objects and store them in a Movie collection variable. The Movie collection is also a class that is comprised of a set of functions. A vector of Movie objects in the member variable of the Movie Collection class. Further, by using the vector variable we want to be able to do a set of tasks. These tasks will be implemented inside the Movie Collection class. The declaration of the Movie Collection class is shown in the following: //Movie class: with all inline methods class Movie { private: std::string title; // title with space allowed unsigned year; il positive value public: void settitle(std::string n) { title = n; } std::string gettitle() { return title; } void setyear(int year_param) { year = year_param; } int getyear() { return year; } // creating a single string value out of // all the fields of the Movie object std::string to_string() { std::string result = title + "(". std::to_string(year) +")"; return result; } }; // Movie class ends. Use the given template file and complete the functions of the Movie Collection class in order to achieve the following tasks (inside the code, we have provided written comments to describe the steps you should do to complete the functions): // this collection class employs a vector variable to store // Movie records class MovieCollection { private: std::vector

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

Database Systems For Advanced Applications 18th International Conference Dasfaa 2013 Wuhan China April 22 25 2013 Proceedings Part 2 Lncs 7826

Authors: Weiyi Meng ,Ling Feng ,Stephane Bressan ,Werner Winiwarter ,Wei Song

2013th Edition

3642374492, 978-3642374494

More Books

Students also viewed these Databases questions

Question

a. Show that f (x) is indeed a probability density function.

Answered: 1 week ago