Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need it by Drjava program A Diamond Program Objective: Write a class that uses the shape interface to now draw a diamond First download

I need it by Drjava program image text in transcribed
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 ShapeInterface to use in your code Write an INTERFACE called DiamondInterface which inherits from Shapelnterface Create the following method definitions 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 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 One that has the . Offiset- used in the parent class . width .Accessors and Mutators for each variable MAKE SURE THE MUTATORS CHECK FOR VALID VALUES! Create the following Methods set Width this sets the width of the diamond. This must be implemented just like the interface. This number must be odd. drawHere this draws the diamond and overrides the method in ShapeBasics drawTopV- this private method draws the top part of the diamond draw BottomV- this private method draws the bottom part of the diamond Create the following static methods skipSpaces this takes in a certain number of spaces to skip which means drawing" Example Dialog: Welcome to the diamond drawer Enter the diamond size followed by the offset or 0 to quit Enter the diamond size followed by the offset or 0 to quit bye! 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 ShapeInterface to use in your code Write an INTERFACE called DiamondInterface which inherits from Shapelnterface Create the following method definitions 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 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 One that has the . Offiset- used in the parent class . width .Accessors and Mutators for each variable MAKE SURE THE MUTATORS CHECK FOR VALID VALUES! Create the following Methods set Width this sets the width of the diamond. This must be implemented just like the interface. This number must be odd. drawHere this draws the diamond and overrides the method in ShapeBasics drawTopV- this private method draws the top part of the diamond draw BottomV- this private method draws the bottom part of the diamond Create the following static methods skipSpaces this takes in a certain number of spaces to skip which means drawing" Example Dialog: Welcome to the diamond drawer Enter the diamond size followed by the offset or 0 to quit Enter the diamond size followed by the offset or 0 to quit bye

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 Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

11 Recruitment strategies.

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago