I have mostly the entire program done but I am having a couple issues. I need to get titles of five movies from the user and store them in the proper member variable for each instance of the five movies at the end of the program. This is what I have so far. I also need to add / between the re-order date and some spaces between the first two parts.

#include <iostream>

using namespace std;

//Structure for each video information
struct Video

string movieTitle;
int numberCopies;
string videoType;

struct re_order_Date

int month;
int day;
int year;

void get_Video(Video shows[], int number_of_shows);

int main()

Video videoInfo;
videoInfo.movieTitle = "Fight Club";
videoInfo.numberCopies = 15;
videoInfo.videoType = "Mystery";

cout<<"The Title of the movie is: "<<videoInfo.movieTitle<<endl;
cout<<"The number of copies are: "<<videoInfo.numberCopies<<endl;
cout<<"The type of video is: "<<videoInfo.videoType<<endl;

Video videoinfo2;
re_order_Date reOrderDate;
videoinfo2.movieTitle = "Requiem for a dream";
videoinfo2.numberCopies = 10;
videoinfo2.videoType = "Drama";
reOrderDate.month = 05;
reOrderDate.day = 17;
reOrderDate.year = 2011;

cout<<"The Title of the movie is: "<<videoinfo2.movieTitle<<endl;
cout<<"The number of copies are: "<<videoinfo2.numberCopies<<endl;
cout<<"The type of video is: "<<videoinfo2.videoType<<endl;
cout<<"The re-order date of the movie is: "<<reOrderDate.month <<reOrderDate.day <<reOrderDate.year <<endl;

Video allVideos[5];

void getVideo (Video shows[],int number_of_shows);

6 Years
Discussion Span
Last Post by jonsca

Is there any requirement as to the ordering of the videos, or is it first entered goes into slot 0, etc?

The spacing issues and slashes are just basic modifications to your cout statements, what specifically are you having problems with in that department?


It doesn't matter which order the movies are entered in. Yes the first entered goes into slot [0]. I just don't know how to add a space or blank space in between the first movie information and the second movie information.


Two answers, since your description leaves too much out so it's hard to understand your problem:

1) Since the movie information should go into an array of structures, you don't need any spaces between anything.

2) cout << " "; And please format your code. It's very hard to follow.


Loop over the number of shows, and since shows is an array of structs, shows[0] is the first show, so use the dot operator on it just like you did in lines 28-30.

After line 48, or even on line 48, output an extra endl or two. It doesn't have to be an endl, it could be a "\n" (which doesn't automatically flush the buffer).

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.