Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7699137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:24:30+00:00 2026-05-31T22:24:30+00:00

Question #3 for the day. I’ve got to design a program that can read

  • 0

Question #3 for the day. I’ve got to design a program that can read in a specific Radius from a user, then display A/D/C of the relevant circle. I’ve written up the constructor I need to do this, but I seem to have gotten confused on what I’m supposed to do with it.

How do I take what I’ve got in the constructor and use it in main?

Relevant constructor code:

public class GetCircle {
private float radius;
private double diameter,circumference,area;

public GetCircle(float getRadius, double setDiameter, double setCircumference, double setArea){
    radius=getRadius;
    diameter=setDiameter;
    circumference=setCircumference;     
    area=setArea;
}
public void setRadius(float getRadius){
    radius=getRadius;
}
public float getRadius(){
    return radius;
}   
public void setDiameter(double setDiameter){
    diameter=setDiameter;
}
public double setDiameter(){
    return diameter;
}
public void setCircumference(double setCircumference){
    circumference=setCircumference;
}       
public double setCircumference(){
    return circumference;
}
public void setArea(double setArea){
    area=setArea;
}
public double setArea(){
    return area;
}
public void answer(){
    System.out.println("The Radius that you specified was: " + getRadius());
    System.out.println("The Diameter of your circle is: " + setDiameter());
    System.out.println("The Circumference of your circle is: " + setCircumference());
    System.out.println("The Area of your circle is: " + setArea());
    }

}

Relevant Main method:

import java.util.Scanner;
public class Circle {

public static void main (String[] args){
    double PI = 3.14159;
    Scanner input = new Scanner(System.in);
    System.out.println("Hello, for this exercise we require that you input the Radius of the circle of your choosing: ");


}

}

I’ve really got two questions I suppose:
1) How to I take what I’ve got from my constructor class and bring it into my main method.
2) Where is the best place to define the “math” for the circle (IE 2πr etc).

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:24:31+00:00Added an answer on May 31, 2026 at 10:24 pm
    1. You would want to capture the input through the use of the Scanner class. You would want to do sanity checks on whether or not they enter a word instead of an integer, but Scanner is a good place to start.

    2. Any and all relevant operations to an object should belong inside of the object. In your case, since a circumference relates to the circle, then you would be better served creating a method like public double getCircumference() inside of Circle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

G'day, Edit: While this question covers a situation that can arise in programming a
Good day! I have got a question about the Internet Explorer 9. Can anyone
3rd Drupal question in a day.. guess what I'm doing! OK, I've got the
Good day, I've got a simple CSS question. I'm trying to change a table
I got this question in an interview the other day and would like to
This question is related to one I asked the other day which I got
Okay, this is got to be the easiest question of the day. This is
There is no day on SO that passes without a question about parsing (X)HTML
Stupid question of the day: where can I find info in the docs about
Good day, I have a question here. I am trying to fetch image from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.