a. Construct a class named Rectangle that has deuble-precision data members named length and width. The class should have member methods named perimeter() and area() to calculate a rectangle's perimeter and area, a member method named setData() to set a rectangle's length and width, and a member method named showData() that displays a rectangle's length, width, perimeter, and area. b. Include the Rectangle class constructed in Exercise 9a in a working C++ program.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter11: Introduction To Classes
Section11.1: Classes
Problem 8E
icon
Related questions
Question
a. Construct a class named Rectangle that has deuble-precision data members
named length and width. The class should have member methods named perimeter() and
area() to calculate a rectangle's perimeter and area, a member method named setData() to
set a rectangle's length and width, and a member method named showData() that displays a
rectangle's length, width, perimeter, and area.
b. Include the Rectangle class constructed in Exercise 9a in a working C++ program.
Transcribed Image Text:a. Construct a class named Rectangle that has deuble-precision data members named length and width. The class should have member methods named perimeter() and area() to calculate a rectangle's perimeter and area, a member method named setData() to set a rectangle's length and width, and a member method named showData() that displays a rectangle's length, width, perimeter, and area. b. Include the Rectangle class constructed in Exercise 9a in a working C++ program.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,