Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can you help me figure out the following in java? Create a new class named Flower with the following fields and methods: Fields: - color

can you help me figure out the following in java?

Create a new class named Flower with the following fields and methods:

Fields:

- color that stores the color of the flower (pink, yellow, red ).

- two double variables d1 and d2 indicating the diagonals of the flower's petal. These values should be positive.

Methods:

1. readFlower() that reads the values of the flower fields from the keyboard.

2. flowerArea() is a static method that computes the area of the flower's petal using the following equation: area = .

3. displayFlower() that shows the information of the flower (color and area).

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

Ai And The Lottery Defying Odds With Intelligent Prediction

Authors: Gary Covella Ph D

1st Edition

B0CND1ZB98, 979-8223302568

Students also viewed these Databases questions

Question

Describe the types of power that effective leaders employ

Answered: 1 week ago

Question

Describe how leadership styles should be adapted to the situation

Answered: 1 week ago