So I am working on this project that ask for the user to input practically as many customers into the system as needed. They should input customer name, motion Picture, quanity of each item and cost. Later it should provide sum, average and etc. (average, and etc I haven't implemented just yet).

**UPDATE:**

I have fixed my string but I think something is wrong with my print array. Not exactly sure how to get my name into a string so that I can keep Alyssa and Dave There error is just a bunch of numbers that just keep going:

PROGRAM RUNNING

```
Welcome to our storing system for your account information
If you wish to begin inputting information, Please enter 1 for Yes and 2 for No
1
Enter customer's first name:
Alyssa
To choose which Motion Picture that you purchased a DVD under:
Enter 1 for Paramount. Enter 2 for Twentieth Century Fox.
Enter 3 for Warner and 4 for WaterFront

Input the data in the following format.
Motion Picture Number <space> Amount of motion pictures purchased <space>  Cost of movies
Enter -1 <space> 0 <space> 0 <space> to end

1 2 20
Enter Motion Picture <space> Amount purchased <space> Cost of movies
2 33 201
Enter Motion Picture <space> Amount purchased <space> Cost of movies
-1 0 0
Still have more employees? Enter 1 to add them or 2 to end

1
Enter customer's first name:
Dave
To choose which Motion Picture that you purchased a DVD under:
Enter 1 for Paramount. Enter 2 for Twentieth Century Fox.
Enter 3 for Warner and 4 for WaterFront

Input the data in the following format.
Motion Picture Number <space> Amount of motion pictures purchased <space>  Cost of movies
Enter -1 <space> 0 <space> 0 <space> to end

1 4 20
Enter Motion Picture <space> Amount purchased <space> Cost of movies
-1 0 0
Still have more employees? Enter 1 to add them or 2 to end

2

```

ERROR

Listed below is your totals within each Motion Picture Company
--------------------------------------------------------------

Customer Name ParamountTwentieth Century Fox WarnerWaterFront
Dave 0 Dave 20 Dave 0 Dave 20 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 0 Dave 

The print I want:\*\*

```
 Customer Name    Paramount   Twentieth Century Fox    Warner    WaterFront   Total

 Alyssa              2               4                   0            0        80
  Dave               3               0                   0            0       66.00

```

\*\*

and so forth

MotionPicture.h

```
#ifndef MOTIONPICTURE_H
#define MOTIONPICTURE_H
#include <cstring>

using namespace std;

class motionPicture {

    public:

    motionPicture();
    void getData();
    static const int rows = 6;
    static const int columns = 100;
    void printArray();
    void getName();
    void setName();

    private:
            int company;
            double table[rows][columns];
            string name;

 };

 #endif

```

MotionPicture.cpp

```
 #include <iostream>
 #include "motionPicture.h"
 #include <iomanip> //to use setw
 #include <cstring>
 #include <string>

 using namespace std;

 motionPicture :: motionPicture() {

    //initalize the table
    for (int i =0; i < rows; i++){

            for (int j=0; j<columns; j++){

                    table[i][j] =0;
            }//end j for loop
    }//end i for loop

}//end constructor

void motionPicture :: setName(){

    cout<<"Enter customer's first name: " <<endl;
    cin.ignore(numeric_limits<std::streamsize>::max(), '\n');
    getline(cin, name);
}//end setName

void motionPicture :: getName() {
    cout<< name;
//}//end getName

void motionPicture:: getData() {

    int system;
    int motion, quanity;
    double cost;

    cout <<"If you wish to begin inputting information, Please enter 1 for Yes and 2 for No"<<en$
    cin >> system;

    while (system !=2)
    {
    setName();
    //getName();

    cout <<"To choose which Motion Picture that you purchased a DVD under:"<<endl;
    cout <<"Enter 1 for Paramount. Enter 2 for Twentieth Century Fox."<<endl;
    cout <<"Enter 3 for Warner and 4 for WaterFront"<<endl<<endl;

    cout <<"Input the data in the following format."<<endl;
    cout <<"Motion Picture Number <space> Amount of motion pictures purchased <space>  Cost of m$
    cout <<"Enter -1 <space> 0 <space> 0 <space> to end"<<endl<<endl;

    cin >> motion >> quanity >> cost;

    while (motion != -1) {

                    table[motion-1][quanity-1] +=cost;

                    cout <<"Enter Motion Picture <space> Amount purchased <space> Cost of movies$
                    cin >> motion>> quanity >>cost;
            }//end cost while
    cout<<"Still have more employees? Enter 1 to add them or 2 to end" <<endl<<endl;
    cin >>system;
    }//end system while
}//end getData

void motionPicture :: printArray() {

cout <<"Listed below is your totals within each Motion Picture Company"<<endl;
cout <<"----------------------------------------------------------------"<<endl;

cout<<"Customer Name" <<setw(15) << "Paramount" <<setw(11) << "Twentieth Century Fox"
    << setw(23)<<"Warner" <<setw(8) <<"WaterFront" << setw(12)<<endl;
    for (int i= 0; i <rows; i++){
            //for(int j=0; j<100; j++){
            double total =0;
               // begin to print the table
               for (int j=0; j<columns; j++) {
                getData();
               cout table[i][j] << " ";
            //input total
            total += table[i][j];
            }//end j loop
    cout <<total<<"\n";
    }//end i loop
 }//end print

```

motionRun.cpp

```
 #include <iostream>
 #include "motionPicture.h"

 using namespace std;

 int main () {

    cout << "Welcome to our storing system for your account information"
    <<endl;

    motionPicture objMotion;
    objMotion.getData();
    objMotion.printArray();

 return 0;
 }

```