Hi guys just started learning programming using kpl and need help to draw a circle, the program needs to draw a circle from an X and Y position given by the user and the user will need to give the size of the circle, apparantly we can use the " circle method " however I have no idea what the circle method is. :(.
We were told to use our rectangle code for this, which we had to do ourselves and that was easy. Here is the rectangle code, cam anyone give me some pointers as to what i am looking for as 2-3 hours on this and my brain is stumped.
// Declare your variables just beneath main(). Variables should be
// declared with a proper data type and number
Define lenght As Int
Define height As Int
Define area As Decimal
// Move pen to start position
Pen(False)
MoveTo(0,0)
// Obtain input from user using console mode
ShowConsole()
SetConsoleHeight(150)
ConsoleWriteLine("Measurements for Rectangle (between 1 and 10 units)")
Lenght = ConsoleReadline("Enter the lenght of the rectangle: ",True)
height = ConsoleReadline("Enter the height of the rectangle: ",True)
area = lenght*height
// Draw rectangle in graphics mode from position (0,0)
Pen(True)
Color(Blue)
PenWidth(5)
MoveTo(lenght*100,0) // Move to the right
MoveTo(lenght*100,100*height) // Move down
MoveTo(0,100*height) // Move to the length
MoveTo(0,0) //Move to the start position
// Set pen to false and return to intial position
Pen(False)
MoveTo(0,0)
// Display Area on graphics mode
MoveTo(0, height*100+5)
Print("Area: "+ area + " units")
// Display end program in console mode
ConsoleWriteLine("")
ConsoleWriteLine("Program Finished")
End Method