ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 26 Apr 2017 My Price 8.00

JavaFX application class

When I use the command prompt to run this file it does compile, then when I try to run the program it gives me an error. Error: Main method not found in class Polygon, please define the main method as:

  public static void main(String[] args)

or a JavaFX application class must extend javafx.application.Application

 

 

How do I fix this, because when I add the main method, it will not compile.

 

 

/**
* Polygon Class
*/
public class Polygon {
private int numSides;
private double sideLength;
private double xCoord;
private double yCoord;
private double apothem;
public double perimeter;
/**
* constructor with no argument
*/
public Polygon() {
numSides = 4;
sideLength = 5.0;
xCoord = 0.0;
yCoord = 0.0;
apothem = 5.0;
perimeter = 20.0;
}
/**
* constructor with parameters
*/
public Polygon(int numSides, double sideLength, double xCoord, double
yCoord, double apothem) {
this.numSides = numSides;
this.sideLength = sideLength;
this.xCoord = xCoord;
this.yCoord = yCoord;
this.apothem = apothem;
}
// getters and setters
public int getnumSides() {
return this.numSides;
}
public void setnumSide(int numSides) {
this.numSides = numSides;
}
public double getsideLength() {
return this.sideLength;
}
public void setsideLength(double sideLength) {
this.sideLength = sideLength;
}
public double getxCoord() {
return this.xCoord;
}
public void setxCoord(double xCoord) {
this.xCoord = xCoord;
}
public double getyCoord() {
return this.yCoord; }
public void setyCoord(double yCoord) {
this.yCoord = yCoord;
}
public double getApothem() {
return this.apothem;
}
public void setApothem(double apothem) {
this.apothem = apothem;
}
public double getperimeter() {
return this.numSides * this.sideLength;
}
public double getArea() {
return 0.5 * apothem * getperimeter();
}
// returns string form of polygon
public String toString() {
return "(numsides=" + numSides + ", sideLength=" + sideLength + ",
xcoord=" + xCoord + ", ycoord=" + yCoord
+ ", apothem=" + apothem + ")";
}
}

Answers

(11)
Status NEW Posted 26 Apr 2017 03:04 AM My Price 8.00

-----------

Attachments

file 1493178221-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)