Advertisement
veronikaaa86

09. Centuries to Minutes

May 25th, 2022
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. package dataTypesAndVariables;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P09CenturiesToMinutes {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8.  
  9. byte centuries = Byte.parseByte(scanner.nextLine());
  10.  
  11. int years = centuries * 100;
  12. double days = years * 365.2422;
  13. double hours = days * 24;
  14. double minutes = hours * 60;
  15.  
  16. System.out.printf("%d centuries = %d years = %.0f days = %.0f hours = %.0f minutes",
  17. centuries, years, days, hours, minutes);
  18. }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement