Paste Search Dynamic
Recent pastes
totalTransactions
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Main
  9. {
  10.         public static void main (string[] args) throws java.lang.exception
  11.         {
  12.                
  13.                 date now = new date();
  14.     calendar cal = calendar.getInstance();
  15.     cal.setTime(now);
  16.  
  17.     date endDate = cal.getTime();
  18.     cal.add(calendar.HOUR, -1);
  19.     date startDate = cal.getTime();
  20.    
  21.                 integer totalFailed = 20;
  22.                 integer total = 20005;
  23.                 double totalFailedTransactions = totalFailed;
  24.     double totalTransactions = total;
  25.     double percentage = (totalFailedTransactions / totalTransactions) * 100;
  26.     system.out.println(percentage);
  27.     system.out.println(startDate);
  28.     system.out.println(endDate);
  29.         }
  30. }
Parsed in 0.019 seconds