Answered step by step
Verified Expert Solution
Question
1 Approved Answer
public class Cylinder { public void smoothen ( ) { System.out.printin ( Smoothening . . ) ; } } public abstract class Vessel
public class Cylinder
public void smoothen
System.out.printinSmoothening;
public abstract class Vessel
private Engine e;
implements Steerable f
public Engine getEngine
return e;
public void setEngine Engine e
this.e e;
public abstract void turnon;
public class Engine
private Cylinder y;
private int cyls ;
static final int maxCyLinders ;
public void addCylinder Cylinder y
if cyls maxCyLinders
this.ycyls y;
public interface Steerable
public void turnString s;
public class Boat extends Vessel
public void turnStrings
System.out.printlnSteering s;
public void turnon
System.out.printlnTurn On;
public class Factory
public void build
Boat b new Boat;
Engine e new Engine;
boolean needsCylinder true;
Add just one cylinder if needed
if needsCylinder
Cylinder c new Cylinder ;
csmoothen;
eaddCylinder c;
b setEnginee;
Please create a structural class diagram of the above code. Include all classes, associations complete with needed cardinalities and needed arrowtips specializations and realizations. Use wwwdraw.io to create the diagram,
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