Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write in java .. This assignment problem is to practice using existing Java library classes and creating your own graphical class. You are asked to

write in java .. image text in transcribed
image text in transcribed
This assignment problem is to practice using existing Java library classes and creating your own graphical class. You are asked to implement a class Flower, that represented by three values x center, y center, and radius. The x center, and y center is the x, y coordination's of the center of a Flower class. The radius is the radius of the circle around the Flower Create a NetBeans project named HW1Yourld. Create a class named Flower stored in a file Flower.java, a component class to create Flower objects, and a tester class named HWI Yourld.java. Class Flower Definition: .Define three double instance variables to hold a Flower object x center, y center, and radius Provide the following as public interface of class Flower A constructor that receives three parameters to initialize the three instance variables. Flower (double x, double y, double radius) A constructor that receives two parameters; a Point parameter represent the center of the flower and the radius. Flower (Point center, double radius) You need to import java.awt Point before the definition of class Flower A mutator method to set the value of x center coordination A mutator method to set the value of y center coordination A mutator method to set the value of radius An accessor method to get the value of radius A scale method is a mutator method that receives a factor and changes the radius by multiplying the radius by a factor A translate method is a mutator method that receives x, and y distance values and changes the the x center, and y center by adding their values by the distances A draw method that draws the flower object. It receives a Graphics2D parameter Class HW1 Yourld: Includes only the main method Method main Sets a frame to show the application Create an object of FlowerComponent Class FlowerComponent Includes a paintComponent method Page 1 of 3 The paintComponent method creates and draw some flowers (at least 5 flowers should be drawn) It should test the methods translate, scale to draw your picture Figure 1 gives a sample output ta Figune Hint: Figure 2 gives drawing to draw a flower (note: biggest circle is not drawn but it has the radius of the flower) Figure 2 This assignment problem is to practice using existing Java library classes and creating your own graphical class. You are asked to implement a class Flower, that represented by three values x center, y center, and radius. The x center, and y center is the x, y coordination's of the center of a Flower class. The radius is the radius of the circle around the Flower Create a NetBeans project named HW1Yourld. Create a class named Flower stored in a file Flower.java, a component class to create Flower objects, and a tester class named HWI Yourld.java. Class Flower Definition: .Define three double instance variables to hold a Flower object x center, y center, and radius Provide the following as public interface of class Flower A constructor that receives three parameters to initialize the three instance variables. Flower (double x, double y, double radius) A constructor that receives two parameters; a Point parameter represent the center of the flower and the radius. Flower (Point center, double radius) You need to import java.awt Point before the definition of class Flower A mutator method to set the value of x center coordination A mutator method to set the value of y center coordination A mutator method to set the value of radius An accessor method to get the value of radius A scale method is a mutator method that receives a factor and changes the radius by multiplying the radius by a factor A translate method is a mutator method that receives x, and y distance values and changes the the x center, and y center by adding their values by the distances A draw method that draws the flower object. It receives a Graphics2D parameter Class HW1 Yourld: Includes only the main method Method main Sets a frame to show the application Create an object of FlowerComponent Class FlowerComponent Includes a paintComponent method Page 1 of 3 The paintComponent method creates and draw some flowers (at least 5 flowers should be drawn) It should test the methods translate, scale to draw your picture Figure 1 gives a sample output ta Figune Hint: Figure 2 gives drawing to draw a flower (note: biggest circle is not drawn but it has the radius of the flower) Figure 2

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

More Books

Students also viewed these Databases questions

Question

explain what is meant by redundancy

Answered: 1 week ago