How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Scott Your Own Question

Scott
Scott, MIT Graduate
Category: Programming
Satisfied Customers: 17710
Experience:  Specializing in Java and Excel programming (also some C, C++, Fortran)
3546829
Type Your Programming Question Here...
Scott is online now
A new question is answered every 9 seconds

Create a class named Circle with attributes radius, diameter,

This answer was rated:

Create a class named Circle with attributes radius, diameter, circumference and area. Write a constructor that sets the radius to 1. Include the following method:
setRadius()
getRadius()
computeDiameter() diameter = 2 * radius
computeArea() area = 3.14 * r *r

Save the class as Circle.java

Create a class called TestCircle whose main method declares three circle objects. Assign a small value to the radius of the first circle object, assign a fairly large value to the radius of the second circle object. Do not assign any value to the radius of the third circle object. Call computeDiameter and computArea of each circle object and display the results.
Save the application as TestCircle.java.

Hi there,

 

ZIP FILE (with two java files inside)

 

Let me know how it goes, and if you're set, thanks for accepting,

Scott

Scott and other Programming Specialists are ready to help you