Skip to content

Commit f03a2de

Browse files
committed
Week2. SecondRatings constructor.
1 parent 07ca606 commit f03a2de

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

Week2/src/SecondRatings.java

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
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-
910
public 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
}

0 commit comments

Comments
 (0)