Question: Create four different codes named Flower.java, FlowerScene.java, FlowerMain.java and FlowerOverride.java following the guidelines provided. Part A ) Create two classes based on this UML sketch
Create four different codes named Flower.java, FlowerScene.java, FlowerMain.java and FlowerOverride.java following the guidelines provided.
Part A Create two classes based on this UML sketch see image
Flower objects are defined by the xy coordinate of the upper left of the bounding box, the pedal color, and the size. The center circle is always black.
In the FlowerScene class:
Define a constructor that initializes flowers to an empty list, and then fills the list with a few Flower objects of various colors, sizes and locations.
Implement the drawScene method so that it creates a DrawingCanvas object and gets the GraphicsD object. Then loop through your ArrayList named flowers, and call draw with each one.
Part B You need a main method. Create that in a class named FlowerMain in FlowerMain.java:
Part C Now overload the FlowerScene constructor so it is passed a Scanner object and fills the flower list with Flower objects using values red green blue x y size read from a file write an example line to call on a file
Part D Override the FlowerScene constructor by passing it an int numFlowers and using that value to generate that many flowers with random colors, coordinates and sizes.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
