%253Cp%253EPlease%2520help%2520wih%2520either%2520the%2520DVD%2520OR%2520CD%2520
ID: 3551856 • Letter: #
Question
%253Cp%253EPlease%2520help%2520wih%2520either%2520the%2520DVD%2520OR%2520CD%2520Program%253C%252Fp%253E%250A%253Cp%253E%253Cbr%2520%252F%253E%253C%252Fp%253E%250A%253Cp%253EThis%2520program%2520will%2520allow%2520the%2520user%2520to%2520keep%2520track%2520of%2520a%2520CD%2520or%2520DVD%250Acollection.%2520This%2520can%2520only%2520work%2520exclusively%2520with%2520either%2520CDs%2520or%2520DVDs%250Asince%2520some%2520of%2520the%2520data%2520is%2520different%25E2%2580%2594your%2520choice.%2520The%2520data%2520will%2520be%250Astored%2520in%2520a%2520file.%2520The%2520data%2520from%2520the%2520file%2520will%2520be%2520stored%2520in%2520a%2520text%250Afile%2520as%2520records.%2520Each%2520CD%252FDVD%2520in%2520the%2520collection%2520will%2520be%2520represented%250Aas%2520a%2520class%252C%2520so%2520you%2520will%2520have%2520one%2520class%2520that%2520is%2520the%2520CD%252FDVD.%253C%252Fp%253E%250A%253Cp%253E%253Cbr%2520%252F%253E%253C%252Fp%253E%250A%253Cp%253EThe%2520CD%2520class%2520will%2520be%2520limited%2520to%25205%2520songs%2520on%2520that%2520CD.%2520So%2520the%2520class%250Awill%2520need%2520to%2520keep%2520an%2520array%2520of%25205%2520strings%2520for%2520the%2520song%2520titles.%2520It%250Ashould%2520also%2520maintain%2520the%2520length%2520of%2520each%2520song%2520and%2520the%2520total%2520length%250Aof%2520the%2520CD.%2520The%2520class%2520will%2520also%2520have%2520the%2520artist%2520name.%2520%253C%252Fp%253E%250A%253Cp%253E%253Cbr%2520%252F%253E%253C%252Fp%253E%250A%253Cp%253EThe%2520DVD%2520class%2520will%2520have%2520data%2520members%2520for%2520the%2520title%2520of%2520the%2520movie%252C%250Athe%2520length%2520of%2520the%2520movie%252C%2520the%2520year%2520of%2520the%2520movie%2520and%2520the%2520names%2520of%2520two%250Aof%2520the%2520main%2520actors%2520in%2520the%2520movie.%2520There%2520will%2520be%2520a%2520class%2520that%250Amaintains%2520the%2520list%2520of%2520CD%252FDVDs.%2520This%2520list%2520can%2520be%2520limited%2520to%2520just%25205%250ACD%252FDVDs.%2520The%2520list%2520provides%2520methods%2520to%2520add%2520a%2520CD%252FDVD%252C%2520remove%2520a%2520CD%252FDVD%250Aand%2520update%2520a%2520CD%252FDVD.%2526nbsp%253B%253C%252Fp%253E%250A%253Cp%253E%253Cbr%2520%252F%253E%253C%252Fp%253E%250A%253Cp%253EThe%2520program%2520should%2520provide%2520a%2520menu%2520for%2520the%2520user%2520to%2520be%2520able%2520to%250Aadd%252C%2520delete%252C%2520update%2520and%2520display%2520the%2520information%2520in%2520a%2520CD%252FDVD.%253C%252Fp%253E%250AExplanation / Answer
cout << "* DVD Collection *" << endl;
cout << "* *" << endl;
cout << "*****************************************************************************************" << endl;
cout << endl;
cout << endl;
cout << "1. Add DVD" << endl;
cout << "2. Remove DVD" << endl;
cout << "3. Update DVD" << endl;
cout << "4. Show DVDs" << endl;
cin >> selection;
switch (selection)
{
case 1:
{
cout << "To add a new DVD please enter the title, length, year release, actors and their charactors" << endl;
cout << endl;
cout << "Movie Title: ";
getline(cin, title);
cout << endl;
cout << "Length: ";
cin >> length;
cout << endl;
cout << "Year: ";
cin >> year;
cout << endl;
cout << "You entered: " << title << " " << length << " " << year << endl;
cout << endl;
cout << "How many actors/characters do you want to add?" << endl;
cout << "#: ";
cin >> numPeep;
//Loop to pull in actors/ actresses
for (int i = 0; i < numPeep; i++)
{
//Actor and Actress
cout << "Actor/Actress " << (i + 1) << "Name: ";
getline(cin, actor);
cout << endl;
//Character they play
cout << "Character they play: ";
getline(cin, charat);
}
//Store dvd information
DVD.setTitle(title);
DVD.setYear(year);
DVD.setLength(length);
DVD.addActChar(actor, charat);
}break;
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.