Ask your own question, for FREE!
Computer Science 12 Online
OpenStudy (anonymous):

write a program to declare a class rectangle having data members length and breadth. accept this data for one object and display area and perimeter of rectangle.

OpenStudy (anonymous):

which language dear?

OpenStudy (anonymous):

declare class rectangle? is this java?

OpenStudy (anonymous):

it is c++ language program....

OpenStudy (anonymous):

aw. too bad. i'm not good in c++. sorry bro. :(

OpenStudy (anonymous):

its ok dear

OpenStudy (anonymous):

Not going to type out any code, but do you know object oriented programming. I'm guessing that's what the question is geared towards. Here it seems like it wants you to create an object with two properties (length and breadth). Within the object there should be a way of getting perimeter and area (so those are methods of your object). Let me know if this helps in any way.

OpenStudy (anonymous):

see the attached file for code

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!