#include <iostream>
#include <string>
using namespace std;
class Movie {
private:
string director, title, genre, cast, rating, release;
int length;
public:
Movie(){
cout<<"constructor w/ no parameters called"<<endl;
length=0;}
Movie(string d, string t, string g, int l, string c, string r, string re){
director=d;title=d;genre=g;length=l;cast=c;rating=r;release=re;}
string getDirector();
string getTitle();
string getGenre();
int getLength();
string getCast();
string getRating();
string getRelease();
void setDirector(string d);
void setTitle(string t);
void setGenre(string g);
void setLength(int l);
void setRating(string r);
void setRelease(string re);
};
void Movie::setDirector(string d){
director=d;}
void Movie::setTitle(string t){
title=t;}
void Movie::setGenre(string g){
genre=g;}
void Movie::setLength(int l){
length=l;}
void Movie::setRating(string r){
rating=r;}
void Movie::setRelease(string re){
release=re;}
string Movie::getDirector(){
return director;}
string Movie::getTitle(){
return title;}
string Movie::getGenre(){
return genre;}
int Movie::getLength(){
return length;}
string Movie::getCast(){
return cast;}
string Movie::getRating(){
return rating;}
string Movie::getRelease(){
return release;}
int main(){
cout<<"My Movies are: The Departed, The Matrix, Cloverfield"<<endl;
Movie a(Scorcese, the Departed, Drama, 151, Leonardo diCaprio, 5 Stars, 2006);
Movie b(Wachowski Brothers, The Matrix, SciFi, 136, Keanu Reeves, 4.5 Stars, 1999);
Movie c(Reeves, Cloverfield, SciFi, 84, TJ Miller, 4.5 Stars, 2007);
return 0;}
I am trying to create a class movie. When i enter in the Movie a,b,etc. it gives me the error undeclared identifier. I don't understand this error i was under the impression that by syntaxing it in that way it would call upon the constructor and enter it as that. any help?