Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is a C++ Lab Note that you will not use a class template for this assignment. But you will use an abstract class with
This is a C++ Lab
Note that you will not use a class template for this assignment. But you will use an abstract class with inheritance. Assignment Details the project, and be sure that you can compile and run the example code. Rectangle Class Members Your class should have private data fields (member variables or data members) of type double to represent the length and width of the rectangle. Your class should have the following public methods (member functions): - A default (no argument) constructor that sets initializes the length and width of the rectangle to 1.0.. - A constant method called getLength that returns the length of the rectangle. - A constant method called getWidth that returns the width of the rectangle. - A constant method called getArea that returns the area of the rectangle. The area of a rectangle is the length times the width. Your method prototypes should be: Rectangle(); bool set( double newLength, double newWidth ); double getLength() const; double getWidth() const; double getarea() const; file and the implementations for the class methods in a class implementation file. Rectangle Interface File It is important to note: - Constructor methods are not included in the abstract class. - You must include a virtual destructor for the abstract class with an empty implementation (see the examples). Debugging and Testing Tips 1. If you see linker error messages like: Undefined reference to vtable .. undefined reference to 'interface-destructor-method' Requirements: 1. Your program must be split into 4 files: the driver program, the class interface, the class header file (class definition), and class implementation file. 2. The driver program for each programming project should begin with "header comments" containing: - Your name - Programming assignment number - A short description of the program - Course - The date // Programmer: your name /I Project number: 2 Project Desc: Quadratic Expression class Course: COSC 2436 PF III Data Structures Date: date of submission 3. Use a standard indentation convention in your code (see examples in textbook). 4. Use meaningful variable names. 5. Do not use global variables. 6. Your class methods should not contain any input or output operations. All input and output should be done in your driver. Programming Assignment Deliverables When you have completed and tested your code, submit the following files in Blackboard: 1. your driver (test program) 2. RectangleInterface.h 3. Rectangle.h 4. Rectangle.cpp Important: Only submit files that contain C++ code. Do not send me executable files, project or make files, object code files, etc. You may want to create a zipped folder containing the 4 files and submit the zipped fileStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started