Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this assignment, you will write a C++ program to manage the data in a MemoryStorage. NO use of global variables. No UML diagram needed,

For this assignment, you will write a C++ program to manage the data in a MemoryStorage.

NO use of global variables.

No UML diagram needed, could be just written down on another file.

You will implement your program using objects based on a UML diagram provided for you. Learning Outcomes With this assignment, you will: Work with inheritance, composition, aggregation, and association relationships Explain the cardinality of the relationships between classes (i.e., one to one, one to many, many to many) Convert the UML class diagram into an executable C++ application. Instructions You will begin by understanding the UML class diagram below. Your program will define and implement the objects represented in the UML diagram. You are required to build a C++ application that implement this hierarchy according to the following requirements: 1- Complete the missing cardinality of the association between the classes in the attached UML diagram, one example is written for you. For instance, the cardinality of the relationship between the MemoryStorage and Folder classes is one to many or (1 to *) the Star * in a UML diagram means many. The explanation of this relationship is: a specific one memorystorage can have many folders, while a specific folder exists only in one memorystorage. 2- Write the class definition (classname.h) for each class in the UML diagram. The class 4 definition should include the followings: Besides writing the mandatory data member indicated by the relationship between any two classes, add at least one data member to each class. For instance, the MemoryStorage class must have a data member called folder of type Folder because there is a composition relationship between the two classes. So, you need to write this data member and at least another data member. You should decide whether to use a pointer to an object or not based on the semantic of the relationship between the two classes. Please refer to the posted examples on cuLearn. Write the prototype for the constructor of each class. A constructor of a class should initialize all data members that is responsible for. Please refer to the posted examples on cuLearn. Write the prototype of the input function which allows the user to input new values for each object. This method is different from initializing values in the constructor. Write the prototype for the print function of each class. The print function should print all the values of a class data. 3- Write the class implementation of each class (classname.cpp) Write the implementation for the constructor of each class. Use the initializer list in all constructors implementations. Write the implementation of the input function. The input function asks the users to input new values for each object. Write the implementation for the print function of each class. The print function should print all the values of a class data members. In case of the print function for the base and derived classes, you should apply polymorphism. Inside each print function and before printing any value, you should print a message says This print function belongs to the class, then you put the class name. this is important to track the output of your objects. Also, you should use spaces and newlines to make your output neat and clear. 4- Write the main function in which you create objects and call functions. You should have the followings: Create on instance of each class in which you pass the necessary values to initialize that object. Call the print function right after the object creation (i.e., create obj1 then call obj1.print() directly) Call the input function for the same object to input new values, Call the print function again to print the new values. You should repeat this sequence for all objects of all classes

Thank you so much for you're help.

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 Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago