Answered step by step
Verified Expert Solution
Link Copied!

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) file_name : string
(ii) extension : string
(+) default Constructor
(+) setter
(+) getters
(+) virtual destructor
(+) pure virtual merge(file ) :void
(+) virtual print_details : void
Excel
Word
(-) number_of_sheets : int
(-) topics : * string
(+) parameterized Constructor
(-) number_of_topics : "int
(+) setters
(-) number_of_pages : int
(+) getters
(+) parameterized Constructor
(+) virtual destructor
(+) setters
(+) pure virtual merge(Excel ) :void (+) getters
(+) virtual print_details : void
(+) virtual destructor
(+) pure virtual merge(word) :void
(+) virtual print_details : void
Ex 1. File Class
Implement the Class file as described in the UML diagram above; notice that:
1- print_details and destructor are virtual.
2- merge (File) is a pure function.
3- in the print_details function, you must print "The file type has not been specified yet."
Ex 2. Excel Class
Implement Class Excel as described in the UML diagram above.
Notice that:
1- Parameterized constructor that receives all data members, including data members in the base class.
2- In merge, you must add the number of sheets in the receiving object to the current object.
3- in print, you have to print all the details of the object.
4- override the destructor.
Ex 3. Word class
Implement Class Excel as described in the UML diagram above.
Notice that:
1- Parameterized constructor that receives all data members, including data members in the base class.
2- In merge, you must add the number of pages in the receiving object and the number of topics to the current object.
3- in print, you must print all details of the object.
4- override the destructor.
Ex 4. Driver
Implement a driver program to test your code.
1- Create one object of type Word and another of type Excel.
2- Create an array of pointers of type File of size 2. The first pointer points to the first object, and the second pointer points to the second object.
3- Create an array of pointers of type File of size 5, then ask the user to enter the file type (Word or Excel) for each array element.
4- Merge any two objects of type Word, then print the details.
Ex 5. Friend function
Implement the function bool find(Word& 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
image text in transcribed

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

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

What are the five sections of the federal tax return?

Answered: 1 week ago

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago