Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. public class Child {
  2. private int age;
  3. private boolean siblingInProgram;
  4. private int yearsOfAttendance; // prim data types
  5. private String Name; // obj
  6. private int daycareID;
  7. private static int nextId = 1000;
  8.  
  9. public double CalculateBill() {
  10. if (age <= 1) {
  11. return 400;
  12. } else if (age >= 1 && age <= 2) {
  13. return 300;
  14. } else if (age >= 3 && age <= 4){
  15. return 200;
  16. } else
  17. return 150;
  18. }
  19.  
  20.  
  21. public Child(String name, boolean siblingPlan, int currentAge){
  22. Name = name;
  23. siblingInProgram = siblingPlan;
  24. age = currentAge;
  25. yearsOfAttendance = 0;
  26. daycareID = nextId;
  27. nextId += 7;
  28.  
  29. }
  30.  
  31.  
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement