Project I Created in AP Computer Science

Home Forums IT Consulting, Networking And Programming Project I Created in AP Computer Science

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #9525
    ledgetechs
    Keymaster

    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);

    }
    }

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.