Problem: Implement a part of functionality for the Netflix DVD queue. It's a service that allows a user to create a list of desired movies and then sends DVDs with movies on top (what we called head in our lectures) of this list to the subscriber one at a time. A subscriber should be able to create a list of desired movies and manipulate the order in a movie queue in their account. Your program will implement some of the desired functionality by storing the list of movie titles in a linked list. You are provided with the following files available in the "Downloadable files" section:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Problem: Implement a part of functionality for the Netflix DVD queue. It's a service that allows a user to create a list of desired movies and then sends DVDs with movies on top (what we called head in our lectures) of this list to the subscriber one at a time. A subscriber should be able to create a list of desired movies and manipulate the order in a movie queue in their account. Your program will implement some of the desired functionality by storing the list of movie titles in a linked list. You are provided with the following files available in the "Downloadable files" section:

  • MovieList.h contains a class declaration for the class that represents a list of movies. top refers to the head position of a list and bottom refers to the tail or end position of a list.
  • Driver.cpp contains the main function you can use to test your implementation.

*** NOTE: Please do not change any of the function names since our automated test script calls those functions. Changing function names or parameters will break the automated test script.

You will be responsible for providing the MovieList.cpp file, including the implementation of the MovieList member functions (described below). The class is defined in the MovieList.h file.:

  • MovieList and ~MovieList: create an empty list and deallocates all the nodes in the list, respectively.
  • display(ostream& out) Print movie titles from top to bottom, with positions numbered (put a colon and space between the number and the movie title) one movie per line. Use out << instead of cout <<.
  • addToTop(string title) Add a movie to the top (head) of the list
  • addToBottom(string title) Add a movie to the bottom (end) of the list
  • moveToTop(string title) Move a movie with given title to position 0 (top or head)
  • moveToPosition(string title, int position) Move movie with given title to position n (0 is top or head)
  • remove(int n) Remove a movie at the given position. Return true if successful, false if there is no movie at position n.

Input/Output:

Use the provided Driver.cpp file to test your code. I recommend trying to implement one or two functions at a time, and testing them, rather than implementing all the functions and then trying to debug them all at once.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY