Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. /***************************
  2. PROG 10082 Homework 1
  3. Alexander Safos
  4. 991570144
  5. Sept 16th 2019
  6. **************************/
  7.  
  8.  
  9. public class Main {
  10.  
  11. public static void main(String[] args) {
  12. System.out.println("Welcome to Alex's First Programming Assignment!");
  13.  
  14. //Q1
  15. int basketball =8;
  16. int running =10;
  17. int sleeping =1;
  18. int weight =0;
  19. double poundsToKilos =0.454;
  20. double factor = 1.05;
  21. double totalCals = sleeping + basketball +running;
  22. double mins = 30;
  23. double minsToHours = mins/60;
  24. double hours= minsToHours;
  25. double sleepTime=6.5;
  26.  
  27. weight = (int) (125 * poundsToKilos);
  28. running = (int) ((int)(factor * running * weight) *minsToHours);
  29. mins=40;
  30. basketball = (int) ((int) (factor * basketball * weight)*minsToHours);
  31. sleeping = (int) ((int) (factor * sleeping * weight) *sleepTime);
  32.  
  33. System.out.println(sleeping);
  34. System.out.println(basketball);
  35. System.out.println(running);
  36.  
  37. System.out.println("The total number of calories burned is " + totalCals);
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement