Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Find UML attached above. In C++, No Use of global variables. 1- Complete the missing cardinality of the association between the classes in the attached

image text in transcribed

Find UML attached above.

In C++,

No Use of global variables.

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.

Please help!

+ folder + memorystorage Author Folder MemoryStorage 1 E Hard Disk E USB File Access Right + folder + memorystorage Author Folder MemoryStorage 1 E Hard Disk E USB File Access Right

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_2

Step: 3

blur-text-image_3

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

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

Identify ways to increase your selfesteem.

Answered: 1 week ago

Question

What are some of the possible scenes from our future?

Answered: 1 week ago

Question

1. What are your creative strengths?

Answered: 1 week ago