Need some guidence please....

Hey guys I'm an absolute n00b so please be gentle. I'm having trouble with my project was hoping to see if I can get a push in the right direction.

I have to display information on a DVD that a user enters in, the last section where I have to have the Actor/Actress' name and their Character name added displayed. I'm not sure how to do this and my method that I have doesn't seem right.

"intructions"

The DVD class will have data members for the title of the movie, the length of the movie, and the year the movie was released. The class will have a vector which is used to store the name of the actors and actresses in the movie. Another vector will be used to maintain the character names that the actor/actress played in the movie. These two vectors must work in parallel, meaning the first actor/actress in the list must correspond to the first character in the other vector.

For the DVDs:

Movie Title
Length of Movie
Year Released
Actors/Actresses
Characters

Next I've got 3 options to Delete a DVD, Modify a DVD, and show all dvd's.... I don't even know where start, I'd appreciate a kick in the right direction..

Thanks guys, any help would be greatly appreciated!




Header
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

#ifndef DVDHEADER_H
#define DVDHEADER_H

#include <iostream>
#include <vector>
#include <string>

using namespace std;

// DVD Class

class DVD 
{

	// variables
private:

	string title;							// dvd title
	double length;							// dvd length
	int year;								// dvd year released
	

public:

	vector <string> charNames;				// vector for character names
	vector <string> actors;					// vector for actors


		
	DVD();									// constructor for the DVD


	void setYear(int);						// sets the  Movie Year
	void setLength(double);					// sets the Movie length
	void setTitle(string);					// sets the Movie Title
	void addActor(string, string);			// add the actors/actresses name

	string getTitle();						// gets the movie title
	double getLength();						// gets the movie length
	int getYear();							// gets the movie year
	string getActor(unsigned int);			// get actors
	string getCharacter(unsigned int);		// gets character name

	// not sure if this if is the proper function....

	//string getactchar(string, string);		




};
#endif



DVD cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include "DVDheader.h"


// DVD constructor

DVD :: DVD()
{
	title = " ";
	year = 0;
	length = 0;

}

// mutator functions

void DVD::setYear(int y)
{
	year = y;

}

void DVD::setLength(double l)
{

	length = l;
}

void DVD::setTitle(string t)
{
	title = t;

}

void DVD::addActor(string actorName, string characterName)
{
	charNames.push_back(characterName);
	actors.push_back(actorName);

}

// Accessor functions

string DVD::getTitle()
{

	return title;
}

double DVD::getLength()
{
	return length;
}

int DVD::getYear()
{
	return year;

}

string DVD::getActor(unsigned int i)
{
	//return actors;

	if (i >= actors.size())
		return "no data";
	return actors[i];
	
	
}

string DVD::getCharacter(unsigned int i)
{

	//return charNames;
	
	if (i >= charNames.size())
		return "no data";
	return charNames[i];	
}


// not sure how to get this to work...

/*string DVD :: getactchar(string, string)
{
	

	//return actors;
	//return charName;

}
*/


main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
*/

#include <iostream>
#include <string>
#include <iomanip>
#include <vector>

#include "DVDheader.h"

using namespace std;

int main()
{
	// variables

	string movieTitle;					// stores title of movie
	double movieLength;					// stores length of movie
	int yearReleased;				    // stores year of movie
	int choice;							// gets user's choice.
	int numactors;						// gets the number of actors
	string actorname;					// gets actors name
	string charactername;				// gets characters name

	DVD myDVD;							// DVD class object

	// Welcome message

	cout << "Welcome to Tom's DVD Collection Program" << endl;
	cout << "==============================================\n\n" << endl;

	// menu

		cout << "What would you like to do with your DVD collection?" << endl;
		cout << "(Please choose from the options below)" << endl;
		cout << "=======================================================\n" << endl;

		cout << "1.  Add a new DVD" << endl;
		cout << "2.  Remove a DVD" << endl;
		cout << "3.  Update an existing DVD" << endl;
		cout << "4.  Show all DVD's in collection" << endl;
		cout << "5.  Exit" << endl;
		cout << "========================================================" << endl;
		cin >> choice;



		switch (choice)
		{
		case 1:

			cout << "You have chosen to add a new dvd, enter the information below\n" << endl;


			// gets movie title
			cout << "Please enter in the movie title of your DVD: ";
			cin >> movieTitle;

			// gets movie length

			cout << "\nPlease enter in the movie length of your DVD (in minutes): ";
			cin >> movieLength;

			cout << "\nPlease enter in the year that your DVD was released: ";
			cin >> yearReleased;

			cout << "\nPlease enter in the number of actors that are in your movie: ";
			cin >> numactors;

			// loopage for actors

			for (int i = 0; i < numactors; i++)
			{
				// get the actors/actress names 

				cout << "\nActor / Actress: " << (i + 1) << " Name: ";
				cin >> actorname;

				cout << "\nWhat Character name did " << actorname << " have? ";
				cin >> charactername;
			}
				break;
			

			// remove DVD

		case 2:

			// update DVD

		case 3:

			// show all

		case 4:


			// exit

		case 5:

			cout << "You have chosen to exit the program, thanks for using my program have a nice day!" << endl;
			exit(1);


		default: cout << "You must enter a number between 1 and 5" << endl;

			break;
	  }

		// DVD information storage

		myDVD.setTitle(movieTitle);
		myDVD.setLength(movieLength);
		myDVD.setYear(yearReleased);
		//myDVD.addActor(actorname, charactername);

		cout << "\nHere is your Movie information: \n\n";

		cout << "Movie Title: " << setw(10) << myDVD.getTitle() << endl;
		cout << "Length of Movie: " << setw(6) <<  myDVD.getLength() << endl;
		cout << "Year Released: " << setw(8) << myDVD.getLength() << endl;

		cout << "\n";

		// not sure what how to properly call this out here..

		//cout << "Actors / Actress:" << myDVD.addActor(actorname,charactername) << endl;
		
	

}
Last edited on
The instructions are not 100% clear. I think you need to declare a vector<DVD> in your main function so you can add and display the dvds.
Here is the second part of the instructions that has got me confused, again being a n00b.... not sure where to begin.

The program will maintain a list of CD/DVDs. This list will be a vector of that class type (CD or DVD). The program must provide methods (functions) to add a CD/DVD, remove a CD/DVD and update a CD/DVD. There should also be a function that displays the entire list of CDs/DVDs. The output must be a table format, with heading.

Topic archived. No new replies allowed.