File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change 1+ import java .util .ArrayList ;
2+
13/**
2- * Write a description of SecondRatings here.
4+ * Week2. A new class to do many of the calculations focusing on computing averages on movie
5+ * ratings.
36 *
4- * @author (your name)
5- * @version (a version number or a date)
7+ * @author Stanislav Rakitov
8+ * @version 1.0
69 */
7- import java .util .ArrayList ;
8-
910public class SecondRatings {
10- private ArrayList <Movie > myMovies ;
11- private ArrayList <Rater > myRaters ;
11+ private final ArrayList <Movie > myMovies ;
12+ private final ArrayList <Rater > myRaters ;
1213
1314 public SecondRatings () {
1415 // default constructor
1516 this ("ratedmoviesfull.csv" , "ratings.csv" );
1617 }
18+
19+ // The constructor should create a FirstRatings object and then call the loadMovies and
20+ // loadRaters methods in FirstRatings to read in all the movie and ratings data and store them
21+ // in the two private ArrayList variables of the SecondRatings class, myMovies and myRaters.
22+ public SecondRatings (String moviesFileName , String ratingsFileName ) {
23+ FirstRatings firstRatings = new FirstRatings (moviesFileName , ratingsFileName );
24+ myMovies = firstRatings .getMovieArrayList ();
25+ myRaters = firstRatings .getRaterArrayList ();
26+ }
1727}
You can’t perform that action at this time.
0 commit comments