Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

help please

Posted on 2004-10-12
12
Medium Priority
?
238 Views
Last Modified: 2010-03-31
as you know am trying to do a face using defferent methods please help me heres my code it wont compile it gives me this error message :

C:\Documents and Settings\Guicho\My Documents\My Files\HW05\SelfPortrait.java:39: drawArc(int,int,int,int,int,int) in java.awt.Graphics cannot be applied to (int,int,int,int)
      guicho.drawArc (X, Y, HWIDTH, HHEIGHT);


and this is my code :

import java.applet.*;
import java.awt.*;

public class SelfPortrait extends Applet
{
      
      private int HWIDTH=200;
      private int HHEIGHT=200;
      private int X=50;
      private int Y=50;
      
      private Color skinColor=Color.pink;
      private Color eyeColor=Color.blue;


      public void paint (Graphics guicho)
      {
            
            //This are the "methods"
            drawHead(guicho);
            drawNose(guicho);
                                drawMouth(guicho);
                                drawEars(guicho);
                                drawEyes(guicho);

            
            
      }
      
      public void drawHead (Graphics guicho)
      
      {
      guicho.fillOval(X,Y,HWIDTH,HHEIGHT);
      }
      
      public void drawNose (Graphics guicho)
      
      {
      int ancho = HWIDTH/5;
      int alto = HHEIGHT/10;
      int equis = X+HWIDTH/2-3*ancho;
      int igriega = Y+HHEIGHT/4;
      guicho.drawArc (X, Y, HWIDTH, HHEIGHT);
         }
}

please help me my assignment is due in less than an hour tell me what am doing wrong

mijangos
      
0
Comment
Question by:mijangos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 
LVL 37

Accepted Solution

by:
zzynx earned 1000 total points
ID: 12295165
It needs 6 parameters

public abstract void drawArc(int x,
                             int y,
                             int width,
                             int height,
                             int startAngle,
                             int arcAngle)

Parameters:
x - the x coordinate of the upper-left corner of the arc to be drawn.
y - the y coordinate of the upper-left corner of the arc to be drawn.
width - the width of the arc to be drawn.
height - the height of the arc to be drawn.
startAngle - the beginning angle.
arcAngle - the angular extent of the arc, relative to the start angle.
0
 
LVL 16

Assisted Solution

by:suprapto45
suprapto45 earned 1000 total points
ID: 12295383
Hi,
Yes, zzynx is right. To do the method of drawArc, you must have six parameters in it.

guicho.drawArc (X, Y, HWIDTH, HHEIGHT);

Well, your codes only have 4 parameters instead of 6 parameters. Well, if you still have no idea on what are the two parameters, you can leave them ZERO. So try the codes below.

guicho.drawArc (X, Y, HWIDTH, HHEIGHT, 0, 0);

It simply means that you specify arc with the x = X, y = Y, width = HWIDTH, height = HHEIGHT, startAngle = 0 and arcAngle = 0.

Good luck
0
 

Author Comment

by:mijangos
ID: 12295462
thanks guys but is too late i cant submit my assignment anymore deadline is over , thanks for all the help , the only bad thing is that my grade went back to c i was hoping to keep it in b or finally go for an A .

thanks for trying i really appriciete

mijangos
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 37

Expert Comment

by:zzynx
ID: 12295482
What do you try to say? What does it mean for this Q?
I posted 27 minutes after you posted your Q and I'm too late???

>>thanks for trying i really appriciete
So?
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 12295515
Easy....easy......zzynx. However, your explanation does not really make sense mijangos. Explain to us!
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12295540
>> Easy....easy......zzynx.
I was just asking a couple of questions I expect an answer to. That's all
0
 

Author Comment

by:mijangos
ID: 12295559
zzynx it seem you are more upset than myself when i said too late i meant that it was too late for me to submit my assingment not like you guys were the ones , once again thank you for the help .

p.s by the way i think i was very clear at my last post but sometimes when you post some guys get wrong ideas  , and do i have to accept one of your replys even that i dont need help anymore with this question ? or can i leave it blank .
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12295601
>> do i have to accept one of your replys even that i dont need help anymore
No, you don't **have to**.

If you want to delete this question, post a zero-point question in http://www.experts-exchange.com/Community_Support/

Subject: Moderator Please Delete
Body: Please delete this question:
http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21166180.html

>>zzynx it seem you are more upset than myself
My answer to that is:
>>when you post some guys get wrong ideas
;°)
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 12295696
:) next time better mijangos.

zzynx >> yes.....**have to**. Okay then, you are a great Java player :).
0
 

Author Comment

by:mijangos
ID: 12295749
i think is fair to give split the points as you gave almost the same answer which solved my problem .
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12295819
Thanks mijangos.
I see this acceptance as an appreciation of our tries to help you.
Much appreciated.
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 12295828
Thanks too mijangos,

My appreciation to you.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question