Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. public class Routine
  2. {
  3. private double sleep;
  4. private double fun;
  5. private double school;
  6. private double sports;
  7. private double totalHours;
  8.  
  9. public Routine(double sleepHours, double funHours, double schoolHours, double sportsHours)
  10. {
  11. sleep = sleepHours;
  12. fun = funHours;
  13. school = schoolHours;
  14. sports = sportsHours;
  15. }
  16.  
  17. public Routine ()
  18. {
  19. sleep=0;
  20. fun=0;
  21. school=0;
  22. sports=0;
  23. }
  24.  
  25. public void setSleep(double hoursSleep)
  26. {
  27. sleep= hoursSleep;
  28. }
  29.  
  30. public void setFun(double hoursFun)
  31. {
  32. fun = hoursFun;
  33. }
  34.  
  35. public void setSchool (double hoursSchool)
  36. {
  37. school= hoursSchool;
  38. }
  39.  
  40. public void setSports (double sportsHours)
  41. {
  42. sports=sportsHours;
  43. }
  44.  
  45. public void printTotal()
  46. {
  47. System.out.println("Weekly Totals");
  48. System.out.println("Sleep: " + (sleep7));
  49. System.out.println("School: " + (school7));
  50. System.out.println("Sports: " + (sports7));
  51. System.out.println("Fun: " + (fun7));
  52. System.out.println("Grand Total: " + (7(school+sports+sleep+fun)));
  53. System.out.println("Hours left over: " + (168-(7(school+sports+sleep+fun))));
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement