ACS-1903 Chapter 7: Circle

74 views4 pages

Document Summary

Diameter = 30; xposition = 20; yposition = 60; color = "blue"; isvisible = false; import java. awt. import java. awt. geom. * a circle that can be manipulated and that draws itself on a canvas. * @version 1. 0 public class circle private int diameter; private int xposition; private int yposition; private string color; private boolean isvisible; * create a new circle at default position with default color. public circle() nothing. public void makeinvisible() * move the circle a few pixels to the right. public void moveright() If it was already visible, do nothing. public void makevisible() If it was already invisible, do movehorizontal(20); isvisible = true; draw(); erase(); isvisible = false; movevertical(20); movevertical(-20); movehorizontal(-20); * move the circle a few pixels to the left. public void moveleft() * move the circle a few pixels up. public void moveup() * move the circle a few pixels down. public void movedown() * move the circle horizontally by "distance" pixels. public void movehorizontal(int distance)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers