Details of this Paper

c++ homework

Description

solution


Question

Option A - 100 points maximum;Modify Assignment 8 (or 7, or 5) to;Modify the movies class to created a linked list.;Movies is now the head node pointer.;Sample code will be provided although you are free to ignore it (zero credit for using an existing collection class, and see the note below).;Load the list by inserting movies in ascending sequence by title.;Add an overloaded operator< to the Movie class for this.;Retrieve movies by a search key (not the full title, a search key of "or" should not yield any Toy Story movie).;The key should not be case senstive, 'xx' and 'xX' should both retrieve 'XXX'.;If using Assignment 7/5 as the base, delete the options to retrieve movies by movie number and to get the next sequential movie.;It should not abort if the movie is not found.;You are free to create your own linked list solution, but it must incorporate templates, the node as a class, previous and next link pointers, and separate compilation.;Note the key word 'create', please do not submit canned linked list solutions copied from elsewhere.;Option B - 125 points maximum;Same as Option A, except;A separate List class should be created, which would contain head and tail (last node) pointers, and all node navigation methods.;(Node is still a separate class, which should now have all private members, with the list class as a friend.);Nodes are not referenced outside of the List class, Movies has (or is?) a list object and only references list methods.;The search should start at the end of the list and work backward, returning the last movie in the list containing the search key (which is still the first one found, a search key of "ar" should not yield Avatar).;I Cant Seem to attach the Folder with it on the bottom for some reason. I pasted the homework assignment on the bottom.;Movie.cpp FILE;// Movies.cpp;#include "Movie.h" // include Movie class definition;#include "Movies.h" // include Movies class definition;#include;#include;using namespace std;Movies::Movies(string fn){loadMovies(fn),};void Movies::MakeTable(int S);for (int i = 0, i 0);cout << m.toString() < 0);ratioCalc = ((float)m.getNonUSBoxOffice()/(float)m.getWorldBoxOffice())*100;cout << "The ratio of World Boxx Office to Non-Us Box Office is:;< releaseYear >> boxOffice[WORLD] >> boxOffice[US] >> boxOffice[NON_US] >>;rank[WORLD] >> rank[US] >> rank[NON_US];string Movie::getTitle() {return title,};string Movie::getStudio() {return studio,};long long Movie::getWorldBoxOffice() {return boxOffice[WORLD],};long long Movie::getUSBoxOffice() {return boxOffice[US],};long long Movie::getNonUSBoxOffice() {return boxOffice[NON_US],};int Movie::getWorldRank() {return rank[WORLD],};int Movie::getUSRank() {return rank[US],};int Movie::getNonUSRank() {return rank[NON_US],};int Movie::getReleaseYear() {return releaseYear,};string Movie::toString();ostringstream oS;oS << "\n\n Movie Information\n===================================================;<< "\n Movie Title:\t" << title << " (" << releaseYear << ");<< "\n US Rank & Box Office:\t" << rank[US] << "\t$" << boxOffice[US];<< "\nNon-US Rank & Box Office:\t" << rank[NON_US] << "\t$" << boxOffice[NON_US];<< "\n World Rank & Box Office:\t" << rank[WORLD] << "\t$" << boxOffice[WORLD];<< "\n;return oS.str();Movies.h FILE;// Movies.h;#ifndef MOVIES_H;#define MOVIES_H;#include "Movie.h;#include;using namespace std;class Movies;void MakeTable(int);static const int SizeOfTable = 23298;public;Movies(string);const Movie * operator [] (int) const;static int runHash(string s);private;void loadMovies(string);Movie * movies[SizeOfTable];#endif;Movie.h FILE;// Movie.h;#ifndef MOVIE_H;#define MOVIE_H;#include;using namespace std;class Movie;string title, studio;long long boxOffice[3];short rank[3], releaseYear;enum unit {WORLD, US, NON_US};public;Movie();Movie(string);string getTitle();string getStudio();string toString();long long getWorldBoxOffice();long long getUSBoxOffice();long long getNonUSBoxOffice();int getWorldRank();int getUSRank();int getNonUSRank();int getReleaseYear();#endif;I can email you the folder if you want. Please Let me know.;Thanks

 

Paper#72594 | Written in 18-Jul-2015

Price : $27
SiteLock