// Unit 9.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<iostream>
#include<string>
usingnamespace std;
int main()
{
// Get number of students from user.
int getStudents;
cout << "How many students were surveyed? ";
cin >> getStudents;
// Creating array "setMovies" with size of getStudents using pointer.
int *setMovies;
setMovies = newint[getStudents];
// Storing the amount of movies each student watched into setMovies array.
for (int i = 0; i < getStudents; i++)
{
cout << "How many movies did each student watch: ";
cin >> setMovies[i];
}
for (int i = 0; i < getStudents; i++)
{
int sum = 0;
sum += setMovies[i];
cout << sum;
}
return 0;
}