Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 1 1- Create a class to represent a circle type in java, the class should have the following fields: - id: a variable to

image text in transcribed
Exercise 1 1- Create a class to represent a circle type in java, the class should have the following fields: - id: a variable to hold the ID of a circle. -colour, a variable to hold the colour of a circle -radius: variable to hold the radius of a rectangle. - diameter : variable to hold the diameter of a rectangle. - area : variable to hold the area of a rectangle. 2- The Class has one constructor with three parameters(id, colours, and radius). 3- The class should have a calculation method that calculates the values of the diameter and area of the circle. diameter = 2* radius: area = 3.14" radius radius): 4- The class should have a class method that prints out the circle values. 5- In the main class, declare and instantiate 2 objects of the circle class. 6- Set the variables' values for both objects and call the calculation method, then call the print method to print out the values of the circle

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 Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions