Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The following diagram illustrates the classes you will implement in this lab and their relationships. File ( ii ) type: String ( ii ) size:
The following diagram illustrates the classes you will implement in this lab and their relationships.
File
ii type: String
ii size: int
ii author : string
ii filename : string
ii extension : string
default Constructor
setter
getters
virtual destructor
pure virtual mergefile :void
virtual printdetails : void
Excel
Word
numberofsheets : int
topics : string
parameterized Constructor
numberoftopics : "int
setters
numberofpages : int
getters
parameterized Constructor
virtual destructor
setters
pure virtual mergeExcel :void getters
virtual printdetails : void
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
Step 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