- This topic has 0 replies, 1 voice, and was last updated 2 years, 4 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Home › Forums › IT Consulting, Networking And Programming › Project I Created in AP Computer Science
Tagged: Coding, Java, Math, Programming
Below is a project in which I have made in Java Oracle, which essentially finds the area of a certain shape depending on how many sides it has, and tells you the shapes area with two more sides added as well.
Small Sample of it:
RegularPolygon p1 = new RegularPolygon(numOfSides, sideLength);
double c = p1.getArea();
System.out.println("Area with " + numOfSides + " sides:" + " " + c);<
System.out.println("Incrementing the number of sides by two");
p1.addSides(2);
int d = p1.getNumSides();
double e = p1.getArea();
System.out.println("Area with " + d + " sides:" + " " + e);
}
}