954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Movie Database HW Help

Hey Guys I was wondering if anyone can help me with this assignment like completely walk me through it? I would really greatly appreciate it....... I have tried doing it and have came up with nothing. I have been having a lot of trouble understanding this material this school year. Here is what I have to do:


1. Create a user-defined data type (class) to represent a movie. A movie has
several characteristics. You need to represent at least the following:

1) Title
2) Year
3) Director
4) Genre


Provide at least the following functions:

1) Constructor that takes the title, year, director and genre and initializes an object
2) Destructor
3) Four functions to retrieve the title, year, director and genre respectively for an object

4) Function to display details of a movie

Write a main function to demonstrate each function in the above class.

2. Create a user-defined data type called “MovieDatabase” to store and search
for movie information. This class needs to store a list of movies (store pointers to the Movie class created in Question 1 in a appropriate data structure such as vector, list, etc.). In addition, provide at least the following functions:

1) Default constructor (Note: a default constructor is one that does not take any
parameters) and destructor

2) Function to add a new movie to the database
3) Functions to search for a movie:

1. Search by title – displays a list of movies with given title
2. Search by year – displays a list of movies for given year
3. Search by director – displays a list of movies for given director
4. Search by genre – displays a list of movies for given genre

Write a main function to demonstrate each function in the above class. To demonstrate the search functionality, make sure you add at least four movies into your database before searching.

Note: Although we are writing a “database” class, we are currently not attempting any
persistent storage (writing to a file or a real database which stays alive even after your program quits).

Extra credit option:

Enhance your search functionality by providing at least two functions that can
search by more than one parameter (ex., search by year and by director, search by year and by genre, etc.). Update your main function to demonstrate the new functions.

Menace 83
Newbie Poster
2 posts since Mar 2011
Reputation Points: 10
Solved Threads: 0
 

Read the rules. No homework dumps. You need to post an attempt and ask a specific question.

VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
 

If that may help...

http://www.cplusplus.com/doc/tutorial/classes/

You shouldn't come on that site, copy/paste your homework and say "I don't understand. Please help!".

GDICommander
Posting Whiz in Training
211 posts since Jun 2008
Reputation Points: 72
Solved Threads: 26
 

[CODE]#ifndef MOVIE_H
#define MOVIE_H
#include

using namespace std;

class movie
{
friend ostream& operator<< (ostream&, const movie &);
friend istream& operator>> (istream&, movie &);

public:
void print() const;
void setName(string);
string getMovieNameList() const;
string getMovieYearList() const;
movie(string name = "", string year = "");

private:
string nameList;
string yearList;
};[CODE]

this is all that I have in terms of code at this point

Menace 83
Newbie Poster
2 posts since Mar 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: