Sale!

COP2000 Project 6 solved

$30.00

Category:

Description

5/5 - (3 votes)

Write a C++ program that will use a class called Rectangle that has the following member variables:
length: a float
width: a float
The class should have the following member functions:

constructor – sets the length and width values to 0.0.
setLength() – sets the value of the length variable.
setWidth() – sets the value of the width variable.
getLength() – returns the value of the variable length.
getWidth() – returns the value of the variable width.
getArea() – returns the area of a rectangle, which is calculated as:
area = length * width

getPerimeter – returns the perimeter of a rectangle, which is calculated as:
perimeter = 2 * (length + width)

Write a program that demonstrates the Rectangle class by asking the user for the rectangle’s length and width, creating a Rectangle object, and then reporting the rectangle’s area and perimeter with 2 decimal places each.

Be sure to validate all input values.

A program will all code written in main() or not using a class and object will result in a grade of 0.

To Do:

1. Upload your .cpp file to the Project 6 Drop Box.
2. Be sure to check the Rubrics before you submit your Project. Rubrics tell you exactly what must be included in each project and how much each item is worth.

3. Check the Calendar for the due date.