Advertisement
zainarfi00

Self Check 4.1 & 4.2

Oct 20th, 2015
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. Number 12
  2.  
  3. import java.util.*;
  4. public class Pg301_14
  5. {
  6. public static void main(String[] args)
  7. {
  8. Scanner console = new Scanner(System.in);
  9. System.out.println("How much will John be spending?");
  10. double amount = console.nextDouble();
  11. System.out.println("How much will Jane be spending?");
  12. double amount = console.nextDouble;
  13. Calculate( amount1, amount2);
  14. return();
  15. }
  16. public static double Calculate(double x, double y)
  17. int numBills = (int) (x/20.0);
  18. if (numBills * 20.0 < x)
  19. {
  20. numBills++
  21. }
  22. int numBills2 = (int) (x/20.0);
  23. if (numBills2 * 20.0 < x)
  24. {
  25. numBills2++
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement