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 8764347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:00:43+00:00 2026-06-13T16:00:43+00:00

I don’t know if I’m properly calling a GOval method. My goal is to

  • 0

I don’t know if I’m properly calling a GOval method. My goal is to create the Target corporation logo but with 5 circles. I’m supposed to have the Target symbol centered in the window and have the number of the circles and dimensions controlled by the named constants.

I’m starting with GOval bigCircle and that is my most outer filled circle in color red. Am I properly incorporating the createFilledCircle method?

I only have three circles so far because we’re building off a previous assignment and that assignment only had three circles. Also how does N_CIRCLE fit into the picture?

import acm.program.*;
import acm.graphics.*;
import java.awt.*;


public class TargetSymbol extends GraphicsProgram {

public void run(){

    double x = getWidth() / 2;
    double y = getHeight() / 2;




    GOval bigCircle = createFilledCircle(x - OUTER_RADIUS, y - OUTER_RADIUS, 2 * OUTER_RADIUS, 2 * OUTER_RADIUS);
    createFilledCircle.setFilled(true);
    createFilledCircle.setColor(Color.RED);
    add(createFilledCircle);        

    GOval middleCircle = new GOval(100, 100, 200, 200);
    middleCircle.setFilled(true);
    middleCircle.setColor(Color.WHITE);
            add(middleCircle);      



    GOval innerCircle = new GOval(155, 150, 100, 100);
    innerCircle.setFilled(true);
    innerCircle.setColor(Color.RED);
    add(innerCircle);






}
private GOval createFilledCircle(double x, double y, double r, Color color){
    GOval circle = new GOval( x-r, x-y, 2 * r, 2 * r);
    circle.setColor(color);
    circle.setFilled(true);
    return circle;


}


private static final int N_CIRCLE = 5; 
private static final double OUTER_RADUS = 75;
private static final double INNER_RADIUS = 10;
  • 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-06-13T16:00:44+00:00Added an answer on June 13, 2026 at 4:00 pm

    I would say you have the right idea.

    GOval bigCircle = createFilledCircle(x - OUTER_RADIUS, y - OUTER_RADIUS, 2 * OUTER_RADIUS, 2 * OUTER_RADIUS);
    createFilledCircle.setFilled(true);
    createFilledCircle.setColor(Color.RED);
    

    There is no variable called createFilledCircle, so you can’t set it to be filled, or set it’s color. We could change it to bigCircle, but that would be redundan, as you’re already setting those values in the createFilledCircle() method.

    I would just recommend you get rid of those 2 parts altogether, leaving you with:

    GOval bigCircle = createFilledCircle(x - OUTER_RADIUS, y - OUTER_RADIUS, 2 * OUTER_RADIUS, 2 * OUTER_RADIUS);
    

    N_CIRCLE, I can only assume represents the number of circles there are. For example, if N_CIRCLE is 5, there’s the red outer circle, the white circle inside that, a red circle inside that white circle, etc.

    Thus you want to use a loop that creates the circles relative to the amount of circles you have (N_CIRCLE).

    e.g.

    for(int a = 0; a < N_CIRCLE; a++)
    {
        Create a circle that is smaller than the outer one
        Set it's color/fill etc.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

don't know if the title describes anything about what I'm trying to say but
Don't really know how to formulate the title, but it should be pretty obvious
Don't know how to google for such, but is there a way to query
Don't know why but font is not displaying.Please help. CSS(in css folder): style.css: @font-face
I don't know why, but this code worked for me a month ago... maybe
Don't know whats exactly going on, but it's definitely killing my time for nothing.
Don't know what's wrong here, when I run the application it says Specified method
Don't know if this is the right place to ask this, but I will
Don't know where else to ask, but from one day to the other my
Don't know why this is happening, but after submitting a form via JS (using

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.