For this assignment, you will write a C++ program to manage personal movie collections. You will practice writing simple classes in C++, as as well working with dynamically allocated memory.
With this assignment, you will:
• write code with simple C++ classes, and implement a collection clas
• work with dynamically allocated memory and pointer
• write and package a program following standard Unix programming conventions
You will begin with the Movie class that we worked on during the lectures. You can find this class in the coding examples posted in cuLearn, in section 1.5, program #5 (S1.5.CtorDtor/p5-Movie-conv). You will be modifying this class to add some data members and functions, and to remove others. Modify the Movie class as follows:
(1) remove the screenwriter and duration data members, and add a new data member for the year that the movie was made (this will be represented as an integer); modify the constructor accordingly
(2) modify the print() function so that it prints the all correct data members (title and year)
(3) remove the conversion constructor, and implement a copy constructor
(4) implement a getter for the year data member; you will need this member function in a later step, in order to find the correct position to add a movie to a movie group
You will create a new MovieGroup class that manages a primitive array of movies and provides the required member functions to manipulate those movies. The MovieGroup class will contain the following:
(1) a data member that holds the movie collection
(a) this will be a statically allocated array of Movie object pointers
(b) you will define a preprocessor constant for the maximum number of movies; this can be set to a reasonable number such as 64
(c) you can refer to the coding example in section 1.6, program #5, for examples of the four different kinds of arrays
(2) a data member to track the current number of movies in the array
(3) a constructor that initializes the current number of movies
(4) a destructor that deallocates the dynamically allocated movies contained in the array
(5) a copy constructor that performs a deep copy of the movie group; using correct design principles, this function must call the Movie copy constructor to create a copy of each Movie object
(6) a print() member function that prints out every Movie object contained in the array; using correct design principles, this function must call the print() function of each Movie object
(7) a void add(Movie* m) member function that adds the given movie m to the array in its correct place, in ascending (increasing) order by year (a) you must shift the elements in the array towards the back of the array to make room for the new element in its correct place; do not add to the end of the array and sort; do not use any sorting function or sorting algorithm (b) you must perform all basic error checking
(8) a void merge(MovieGroup& mg) member function that takes every movie in the parameter movie group mg, makes a copy of the movie (using the Movie copy constructor), and adds that movie to the array (a) for example: assuming two movie groups mg1 and mg2, if we have the following function call: mg1.merge(mg2); then every movie in mg2 will be copied and the copy added to mg1; as a result, mg1 will contain all of its own original movies, plus copies of all the movies found in mg2, all organized in ascending order by year (b) you must reuse existing functions everywhere possible, specifically the add() function (c) you must perform all basic error checking
Your main() function must test your program thoroughly. It will declare two movie groups, and initialize them with different movies. It will make a copy of one of the movie groups, and merge this new copy with the other group, so that the copy becomes a “super” group containing all the movies. At the end of the program, it will print all three movie groups. You will write the void initMovies(MovieGroup&, MovieGroup&) global function that initializes two groups of movies. This initialization function will do the following:
(1) dynamically allocate Movie objects for at least 28 different movies, without duplicate information
(2) initialize the two movies groups with at least 15 movies each
(3) a maximum of two movies can be in both groups
(4) the movies must be added to each group in different order of years, so that the movie group’s add() member function is thoroughly tested
MyAssignmenthelp.com has proved to be the best cheap assignment help provider in USA. Despite keeping the prices to a minimum, we keep providing top-notch quality college paper writing services for all types of academic papers. Our wide range of services includes report writing help, help with essays, dissertation writing services, coursework help. Students from all corners of the USA prefer to pay our experts for writing top quality assignments. Moreover, it is guaranteed they won't regret for paying our experts to write assignment.
Just share requirement and get customized Solution.
Orders
Overall Rating
Experts
Our writers make sure that all orders are submitted, prior to the deadline.
Using reliable plagiarism detection software, Turnitin.com.We only provide customized 100 percent original papers.
Feel free to contact our assignment writing services any time via phone, email or live chat. If you are unable to calculate word count online, ask our customer executives.
Our writers can provide you professional writing assistance on any subject at any level.
Our best price guarantee ensures that the features we offer cannot be matched by any of the competitors.
Get all your documents checked for plagiarism or duplicacy with us.
Get different kinds of essays typed in minutes with clicks.
Calculate your semester grades and cumulative GPa with our GPA Calculator.
Balance any chemical equation in minutes just by entering the formula.
Calculate the number of words and number of pages of all your academic documents.
Our Mission Client Satisfaction
Worked great and helped me with my assignment. I would recommend your services to anyone needing it.
Australia
thank you for all. though it was not very smooth at first, however, you all tried your best to work on it to your best abilities. appreciate much
Australia
Awesome, work. I was pleased with the analysis for the discussion regarding the Anti-trust Activities by companies
Australia
THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU
Australia