Guest User

Untitled

a guest
Dec 17th, 2017
70
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 = 2013; // Input: any valid registration year
  5. int currentYear = java.time.Year.now().getValue();
  6.  
  7. double likesPerYear = (double) likesCount / (currentYear + 1 - registrationYear); // Your formula
  8.  
  9. System.out.println(likesPerYear + " likes / year");
  10. }
  11. }
Add Comment
Please, Sign In to add comment