Tasks / Skills • Creating a class in C++. Steps • Create a rectangle class that has the following data o Length as a double o Width as a double Create the following methods A constructor that will initialize the data in the class The ability to set the width The ability to set the length Return the current value of the length Return the current value of the width o Return the perimeter Return the area Prints the area Create a assignment5.cpp file that contain the main() function, declares a rectangle object(s) and uses each of the methods.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 5RQ
icon
Related questions
Question
Tasks / Skills
• Creating a class in C++.
Steps
• Create a rectangle class that has the following data
o Length as a double
o Width as a double
Create the following methods
A constructor that will initialize the data in the class
The ability to set the width
The ability to set the length
Return the current value of the length
Return the current value of the width
o Return the perimeter
Return the area
Prints the area
Create a assignment5.cpp file that contain the main() function, declares a rectangle object(s)
and uses each of the methods.
Transcribed Image Text:Tasks / Skills • Creating a class in C++. Steps • Create a rectangle class that has the following data o Length as a double o Width as a double Create the following methods A constructor that will initialize the data in the class The ability to set the width The ability to set the length Return the current value of the length Return the current value of the width o Return the perimeter Return the area Prints the area Create a assignment5.cpp file that contain the main() function, declares a rectangle object(s) and uses each of the methods.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT