Answered step by step
Verified Expert Solution
Link Copied!

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 1) or one input argument (in which case the height is set to the input value, and the width is set to be 1). 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 (i.e. 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 0 or negative.
Note: parts iii and iv will almost certainly require if statements.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications Dexa 2023 Workshops 34th International Conference Dexa 2023 Penang Malaysia August 28 30 2023 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Maqbool Khan

1st Edition

303139688X, 978-3031396885

More Books

Students also viewed these Databases questions

Question

What lessons in OD contracting does this case represent?

Answered: 1 week ago

Question

Does the code suggest how long data is kept and who has access?

Answered: 1 week ago