-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRATING.java
More file actions
42 lines (34 loc) · 752 Bytes
/
Copy pathRATING.java
File metadata and controls
42 lines (34 loc) · 752 Bytes
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
package pom.kgoeltner;
/**
* Object to represent an individual rating which includes:
* a user, product and rating (int, int, double)
*
* @author Karl Goeltner
* @version February 1, 2020
*/
public class RATING {
private int name;
private int product;
private double rating;
public RATING(int id, int prod, double rate) {
name = id;
product = prod;
rating = rate;
}
// Public accessor for user name
public int getName() {
return name;
}
// Public accessor for product
public int getProduct() {
return product;
}
// Public accessor for rating
public double getRating() {
return rating;
}
@Override
public String toString() {
return String.format("%d %d %.0f%%", name, product, rating);
}
}