summaryrefslogtreecommitdiffstats
path: root/C++/2D Arrays/2D Arrays.cpp
blob: d18f14813383973e21a6d983ec1c41151bd8f8b4 (plain) (blame)
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
// Name: msglm
// Date: Nov 25th 2022
// Program Name: 2D Arrays
// Description: 


#include <iostream>
#include <string>
using namespace std;

//classes
class Person {
    public:
        string movies[2][4];
        void getMovies() {
            cout << "Enter your favorite movies: \n";
            for(int x = 0; x < 2; x++) {
                for(int y = 0; y < 4; y++) {
                    cout << "This will be going in position: (" << x << "," << y << ")\n";
                    getline(cin,movies[x][y]);
                }
            }
        }
        void output() {
            for(int x = 0; x < 2; x++) {
                for(int y = 0; y < 4; y++) {
                    cout << movies[x][y] << endl;
                }
            }
        }
};

int main() {
    Person person;
    person.getMovies();
    person.output();
}
/*
   This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License Version 3 ONLY as published by the Free Software Foundation.

   This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.

   You should have received a copy of the GNU Affero General Public License along with this program.  If not, see <https://www.gnu.org/licenses/>.
   */