Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone help me with my code? It throws an error on Line 39 in the Side extends class. Any help is appreciated!! public class
Can someone help me with my code? It throws an error on Line 39 in the Side extends class. Any help is appreciated!!
public class Main { public static void main(String[] args) { Vertex va = new Vertex(-0.5,0); Vertex vb = new Vertex(0.5, 0); Vertex vc = new Vertex(0,0.866); Side sideA = new Side (va, vb); Side sideB = new Side (vb, vc); Side sidec = new Side (vc, va); Side[] sides = {siden, sideB, sideC}; Triangle tri = new Triangle(sides); System.out.println("tri: " + tri.toString()); 16 } 1 abstract class Polygon { protected int numSides = 0; protected Side[] sides; public int getNumSides() { return numSides; public Side[] getSides() { return sides; public void setNumSides (int numSides) { this.numSides = numSides; public void setSides (Side[] sides) { this.sides = sides; public Polygon(int numSides, Side[] sides) { this.numSides = numSides; this.sides = sides; public double computePerimeter() { int a = this.getNumSides(); double b = 0.0; for(int i = 0; iStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started