In C++ class rectangleType { public:     void setLengthWidth(double x, double y); //Sets the length = x; width = y;     void print() const; //Output length and width     double area(); //Calculate and return the area of the rectangle (length*width)     double perimeter(); //Calculate and return the perimeter (length of outside boundary of the rectangle) private:     double length;     double width; };    Set the length of the rectangle to 24 and the width to 30.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Question
100%

In C++

class rectangleType

{

public:

    void setLengthWidth(double x, double y); //Sets the length = x; width = y;

    void print() const; //Output length and width

    double area(); //Calculate and return the area of the rectangle (length*width)

    double perimeter(); //Calculate and return the perimeter (length of outside boundary of the rectangle)

private:

    double length;

    double width;

};

 

 Set the length of the rectangle to 24 and the width to 30.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT