Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i . Modify the dimension attributes of the Rectangle class to properly handle the double datatype instead of simple integers. ii . Modify the Rectangle
i Modify the dimension attributes of the Rectangle class to properly handle the double datatype instead of simple integers.
ii Modify the Rectangle class to permit construction of rectangles using zero input arguments in which case both height and width are set to or one input argument in which case the height is set to the input value, and the width is set to be Hint: you will need to employ overloading.
iii. Modify the Rectangle class to have method double PrintMaxSide which returns not prints! the largest available dimension between the height and width ie if the height is larger, it should be returned, if the width is larger, it should be returned instead.
iv Modify the Rectangle class to have method void IsValid which either i prints "This is a valid rectangle." If height and width are both positive or ii prints "This is not a valid rectangle." if either height or width is or negative.
Note: parts iii and iv will almost certainly require if statements.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started