Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Workshop #8: Virtual functions and Abstract base classes ********************************************************************************** https://github.com/Seneca-244200/OOP-Workshops/tree/main/WS08 ********************************************************************************** Note : All the code written in workshops and the project must be implemented

Workshop #8: Virtual functions and Abstract base classes

**********************************************************************************

https://github.com/Seneca-244200/OOP-Workshops/tree/main/WS08

**********************************************************************************

Note: All the code written in workshops and the project must be implemented in thesddsnamespace.

  • main.cpp

// Workshop 8: // Version: 1.0 // Date: 2021/6/03 // Author: Wail Mardini // Description: // This file tests the part 1 section of your workshop // Do not modify your code ///////////////////////////////////////////// #include #include #include "baseShape.h" #include "rectangleLabel.h" #include "lineLabel.h" using namespace sdds; using namespace std; int main() { cout cout lineLabel BadOne; rectangleLabel BadRectangle("Bad one", 1, 1); cout cout lineLabel* L = new lineLabel("Separator", 50); rectangleLabel* R = new rectangleLabel("Container", 20, 5); baseShape* S[2] = { L, R }; cout cout cout cout lineLabel two,40 >"; cin >> *L; cout cout cout cout cout cout A 55 frame with 4 space to be printed on screen,55,4 >"; cin >> *R; cout cout cout "| A 55 frame with 4 spaces to be printed on screen | " "+-----------------------------------------------------+" cout cout cout cout delete S[0]; delete S[1]; cout ifstream file("ws8data.csv"); baseShape* sptr; char type; while (file) { sptr = nullptr; type = 'x'; file.get(type); file.ignore(); if (type == 'L') { sptr = new lineLabel; } else if(type == 'R') { sptr = new rectangleLabel; } if (sptr) { file >> *sptr; cout delete sptr; } } return 0; }

PART 1 (100%)

Implement four modules for the following classes;baseShape, labelShape, lineLabelandrectangleLabel

image text in transcribed
baseShape Class public labelShape Class + baseShape public public rectangleLabel lineLabel Class Class labelShape labelShape

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions