Skip to content

Commit

Permalink
Update Post.java
Browse files Browse the repository at this point in the history
  • Loading branch information
410-dev committed Jan 15, 2023
1 parent 5725065 commit 113794d
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,16 @@ public Post(String id) throws SQLException, DataFieldMismatchException {

public String getRating() {
float score = (float) likes / (float) (likes + dislikes);
if (score > 0.75) {
return "Very helpful";
if (score > 0.85) {
return "Trustworthy";
} else if (score > 0.75) {
return "May be trustworthy";
} else if (score > 0.5) {
return "Helpful";
} else if (score > 0.25) {
return "Not so helpful";
return "Neutral";
} else if (score > 0.4) {
return "May be untrustworthy";
} else {
return "Poor";
return "Untrustworthy";
}
}
}

0 comments on commit 113794d

Please sign in to comment.