Advertisement
veronikaaa86

09. Centuries to Minutes

Jan 18th, 2023
920
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. package dataTypes;
  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.         //365.2422
  12.         int years = centuries * 100;
  13.         double days = years * 365.2422f;
  14.         double hours = days * 24;
  15.         double minutes = hours * 60;
  16.  
  17.         System.out.printf("%d centuries = %d years = %.0f days = %.0f hours = %.0f minutes",
  18.                 centuries, years, days, hours, minutes);
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement