Starting from:
$30

$24

Lab #4 Linked Lists – A Movie Repository I: The Movies and Ratings

In this assignment, you are to implement a repository for movies as the first part of an online movie streaming service. This first part will implement the list of Movies and the Ratings of each movie, each as single-link linked lists.




You need to provide a report that shows: (10)




Your class designs
The algorithms used adding/deleting movies and reviews



This should be in pseudo-code or flowcharts, not just the code you ended up writing



Compiling instructions



Sample runs (screenshots are fine)





Part1a: A Rating Class (5)




Design a class, Rating, to hold the rating information.



Private:

Should have at least: rating (int), comment (string)
Public:



Constructor(s)/Destructor as needed
Setters to set the data
Method to print the objecti
Test these to make sure this works.



Part1b: A RatingList Class (20)




Design a class, RatingList, which implements a single-link linked list of Ratings.

A RatingNode struct

Private:

rating (Rating), *next (RatingNode)



Private:

Should have at least: *front (RatingNode)
Public:

Constructor(s)/Destructor
addRating(Rating &r) method



adds the Rating r at the end of the list
deleteRating(Rating &r)

finds and deletes the rating r from the list
Method to print the entire listi
Test to make sure this works
























Part 2a: A RTime Class (5)




Design a class, RTime, to hold time information. This will be used to hold the running time of a movie.

Private:

Should have at least: hours (int), minutes (int)



Public:

Constructor(s)/Destructor as needed
Setters to set the data
Method to print the objecti
Test this to make sure this works.









Part 2b: A Movie Class (10)




Design a class, Movie, to hold movie information.



Private:



Should have at least: title (string), runtime (RTime), *ratings (RatingsList)



Public:

Constructor(s)/Destructor as needed
Setters to set the data



addRating(Rating &r) method to add a rating
deleteRating(Rating &r) method to delete a rating
deleteAllRatings() method to delete all ratings



compare(Movie *m) compare current with m, -1=less than, 0=equal. 1=greater than



Method to print the objecti
Test this to make sure this works.









Part2c: A MovieList Class (35)




Design a class, MovieList, which implements a single-link linked list of Movies sorted by title.

A MovieNode struct

Private:



*movie (Movie), *next (MovieNode)
Private:

Should have at least: *front (MovieNode)
Public:



Constructor(s)/Destructor
addMovie(Movie *m) adds a movie to the list sorted by title
removeMovie(string t) removes movie with title t
deleteAllMovies() removes all movies






© NMJ
ECE 218 Fall







addRating(string t, Rating &r) method

adds the Rating r to the movie of title t
deleteRating(string t, Rating &r)



finds and deletes the rating r from the movie title t
printMovie(string t) print movie and ratings with title t
Method to print the entire listi
Test to make sure this works













































Figure 2 MovieList Linked List
































































Figure 3 Detail of MovieList (shows separate RatingList in each Movie)





























































© NMJ
ECE 218 Fall







Part 3: A MovieNet Class (15)




Design a class, MovieNet, which acts as the entry for our online movie streaming system

Private:

name (string), *movies (MovieList)



Public:

Constructor(s)/Destructor as needed
loadData(string file) loads the movie list from a file
storeData(string file) stores the movie list to a file



Print method to print out the objecti.





































































Figure 4 MovieNet detail structure showing MovieList inside





















































































© NMJ
ECE 218 Fall













File Format:




START

Movie title




Runtime (in minutes)

RSTART

Rating

Comment




Rating

Comment

..

REND




Movie title

Runtime (in minutes)

RSTART

Rating

Comment




Rating

Comment

..

REND




….

END

























All print functions should allow for specification of the output stream and output in a format compatible with the File Format described at the end of the document.


































































© NMJ

More products