Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java A Diamond Program Objective: Write a class that uses the shape interface to now draw a diamond First download the driver and put it
Java
A Diamond Program Objective: Write a class that uses the shape interface to now draw a diamond First download the driver and put it in your project DO NOT ALTER THE DRIVER! Also download the ShapeBasics and Shapelnterface to use in your code an INTERFACE DiamondInterface which inherits from Shapelnterface Create the following method definitions o setWidth this method is used to set the width of the diamond Write a class file called Diamond that DOES NOT HAVE a main method This class implements the DiamondInterface and inherits from ShapeBasics Some of the attributes of Diamond are o width that represents the width of the triangle that has to be odd Create the following Constructors Default sets everything to default values width -0 o One that has the parameters Offset used in the parent class width Accessors and Mutators for each variable MAKE SURE THE MUTATORS CHECK FOR VALID VALUES! Create the following Methods o setWidth this sets the width of the diamond. This must be implemented just like the interface. This number must be odd. o drawHere this draws the diamond and overrides the method in ShapeBasics o drawTopV this private method draws the top part of the diamond o drawBottomV-this private method draws the bottom part of the diamond Create the following static methods o skipSpaces this takes in a certain number of spaces to skip which means drawingStep 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