Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. public class Distance
  2. {
  3.  
  4. public int Feet { get; set; }
  5. public int Inches { get; set; }
  6.  
  7. public Distance()
  8. {
  9. //CTOR No Params Default Settings
  10. Feet = 0;
  11. Inches = 0;
  12. }
  13.  
  14. public Distance(int _Feet, int _Inches) : base()
  15. {
  16. //CTOR W/ Params calls default CTOR
  17. Feet = _Feet;
  18. Inches = _Inches
  19. }
  20.  
  21. public void displayDistance()
  22. {
  23. System.Out.println("Feet: " + Feet + " Inches: " + Inches);
  24. }
  25.  
  26. public void simplifyDistance()
  27. {
  28.  
  29. if(Inches > 6)
  30. {
  31. Feet = Feet + 1;
  32. Inches = 0;
  33. }
  34. else
  35. {
  36. Inches = 0;
  37. }
  38.  
  39. }
  40.  
  41.  
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement