Guest User

Untitled

a guest
May 27th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. public class LikesStatistic {
  2. public static void main(String[] args) {
  3. long likesCount = 102; // Input: any valid number of likes
  4. int registrationYear = 2014; // Input: any valid registration year
  5. int currentYear = java.time.Year.now().getValue() + 1;
  6.  
  7.  
  8. double likesPerYear = (double) likesCount / (currentYear - registrationYear); // Your formula
  9.  
  10. System.out.println(likesPerYear + " likes / year");
  11. }
  12.  
  13. }
Add Comment
Please, Sign In to add comment