Question: write the code with object oriented programming + + language The following diagram illustrates the classes you will implement in this lab and their relationships.
write the code with object oriented programming
language
The following diagram illustrates the classes you will implement in this lab and their relationships.
File
# type: String
# size: int
# author : string
# filename : string
# extension : string
default Constructor
setter
getters
virtual destructor
pure virtual mergefile :void
virtual printdetails : void
Excel
numberofsheets : int
parameterized Constructor
setters
getters
virtual destructor
pure virtual mergeExcel :void
virtual printdetails : void
Word
topics : string
numberoftopics : int
numberofpages : int
parameterized Constructor
setters
getters
virtual destructor
pure virtual mergeword :void
virtual printdetails : void
Ex File Class
Implement the Class file as described in the UML diagram above; notice that:
printdetails and destructor are virtual.
merge File is a pure function.
in the printdetails function, you must print The file type has not been specified yet.
Ex Excel Class
Implement Class Excel as described in the UML diagram above. Notice that:
Parameterized constructor that receives all data members, including data members in the base class.
In merge, you must add the number of sheets in the receiving object to the current object.
in print, you have to print all the details of the object.
override the destructor.
Ex Word class
Implement Class Excel as described in the UML diagram above. Notice that:
Parameterized constructor that receives all data members, including data members in the base class.
In merge, you must add the number of pages in the receiving object and the number of topics to the current object.
in print, you must print all details of the object.
override the destructor.
Ex Driver
Implement a driver program to test your code.
Create one object of type Word and another of type Excel.
Create an array of pointers of type File of size The first pointer points to the first object, and the second pointer points to the second object.
Create an array of pointers of type File of size then ask the user to enter the file type Word or Excel for each array element.
Merge any two objects of type Word, then print the details.
Ex Friend function
Implement the function bool findWord& doc, string topic that searches the topics in the received Word object for the received topic.
Make this function a friend of class Word and modify your main to test this function.with separation with separation
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
