Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Distance
- {
- public int Feet { get; set; }
- public int Inches { get; set; }
- public Distance()
- {
- //CTOR No Params Default Settings
- Feet = 0;
- Inches = 0;
- }
- public Distance(int _Feet, int _Inches) : base()
- {
- //CTOR W/ Params calls default CTOR
- Feet = _Feet;
- Inches = _Inches
- }
- public void displayDistance()
- {
- System.Out.println("Feet: " + Feet + " Inches: " + Inches);
- }
- public void simplifyDistance()
- {
- if(Inches > 6)
- {
- Feet = Feet + 1;
- Inches = 0;
- }
- else
- {
- Inches = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement