Page 1 of 1

use C++ Draw a UML class diagram that describes the classes defined below. Setter and getter functions were omitted for

Posted: Wed Apr 27, 2022 3:15 pm
by answerhappygod
use C++ Draw a UML class diagram that describes the classes
defined below. Setter and getter functions were omitted for
simplicity. Your diagram should capture as much information about
the code as possible. Upload a PDF or image file containing your
diagram
Use C Draw A Uml Class Diagram That Describes The Classes Defined Below Setter And Getter Functions Were Omitted For 1
Use C Draw A Uml Class Diagram That Describes The Classes Defined Below Setter And Getter Functions Were Omitted For 1 (62.77 KiB) Viewed 47 times
#include <list> #include <iostream> class Object { public: virtual void print() const = 0; }; class Point : public Object { private: double x,y; public: void print() const { std::cout<<x<<""«y«< std::endl; } }; class Drawable : public Object { public: virtual void draw() const = 0; }; class Circle : public Drawable { private: Point center; double radius; public: void print() const { center.print(); std::cout << radius << std::endl; } void draw() const { /* ... */ } }; class Picture : public Drawable { private: std::list<Drawable*> items; public: void print() const { for(auto i:items) i->print(); } void draw() const { for(auto i:items) i->draw(); } };