[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

help please

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
mijangos
Asked:
mijangos
  • 5
  • 4
  • 3
2 Solutions
 
zzynxSoftware engineerCommented:
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
 
suprapto45Commented:
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
 
mijangosAuthor Commented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
zzynxSoftware engineerCommented:
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
 
suprapto45Commented:
Easy....easy......zzynx. However, your explanation does not really make sense mijangos. Explain to us!
0
 
zzynxSoftware engineerCommented:
>> Easy....easy......zzynx.
I was just asking a couple of questions I expect an answer to. That's all
0
 
mijangosAuthor Commented:
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
 
zzynxSoftware engineerCommented:
>> 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
 
suprapto45Commented:
:) next time better mijangos.

zzynx >> yes.....**have to**. Okay then, you are a great Java player :).
0
 
mijangosAuthor Commented:
i think is fair to give split the points as you gave almost the same answer which solved my problem .
0
 
zzynxSoftware engineerCommented:
Thanks mijangos.
I see this acceptance as an appreciation of our tries to help you.
Much appreciated.
0
 
suprapto45Commented:
Thanks too mijangos,

My appreciation to you.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now