1. Define the class based on this class diagram Distance - inches:double - feet:
ID: 3540495 • Letter: 1
Question
1.Define the class based on this class diagram
Distance
- inches:double
- feet:int
+ Distance()
+ Distance( in:double, ft:int )
+ Distance( dist:Distance& )
+ setInches( in:double):void
+ getInches():double
+ setFeet( ft:int ):void
+ getFeet():int
+ operator==( dist:Distance& ):boolean + operator+( dist:Distance& ):Distance + operator-( dist:Distance& ):Distance + showDistance():String
1.Define the class based on this class diagram
Distance
- inches:double
- feet:int
+ Distance()
+ Distance( in:double, ft:int )
+ Distance( dist:Distance& )
+ setInches( in:double):void
+ getInches():double
+ setFeet( ft:int ):void
+ getFeet():int
+ operator==( dist:Distance& ):boolean + operator+( dist:Distance& ):Distance + operator-( dist:Distance& ):Distance + showDistance():String
- Write a test program to validate the Distance class that runs from the following menu:
- Add two distances
- Subtract two distances
- Sum an array of distances
- Plot an array of distances as a bar graph.
- Calculate the perimeter and area of a rectangle whose length and width are represented by Distance objects.
Explanation / Answer
hey contact me on gmail for all your programming assignments. i can help you. id is hunain60
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.