Question: package edu.buffalostate.cis 4 2 5 . sp 2 4 . put - your - username - here; / * * * * File: Triangle.java *
package edu.buffalostate.cisspputyourusernamehere;
File: Triangle.java
Create a Java class named Triangle that represents a "triangle"
with the following characteristics:
The class has three private integer instance variables
S S S to store the sides of the triangle.
This class has two constructors:
Constructor # has no parameters and initializes the
triangle's sides to
Constructor # has three integer parameters that
initializes the triangle's sides
This class has a method calculatePerimeter which
returns the perimeter sss of the triangle as an
integer
This class contains a main method which creates an
instance of the triangle object with
S S S and computes the object's perimeter
via calculatePerimeter and outputs the result to the
user's screen.
@author putyournamehere
public class Triangle
private int ;
public Triangle
public Triangle int s int s int s
public int calculatePerimeter
public static void main String args
Triangle t new ; System.out.printlnThe perimeter of t is: tcalculatePerimeter;
When you have this Exercise ready for me to view and grade you should upload your java file here.
File: Triangle.java
Create a Java class named Triangle that represents a "triangle"
with the following characteristics:
The class has three private integer instance variables
S S S to store the sides of the triangle.
This class has two constructors:
Constructor # has no parameters and initializes the
triangle's sides to
Constructor # has three integer parameters that
initializes the triangle's sides
This class has a method calculatePerimeter which
returns the perimeter sss of the triangle as an
integer
This class contains a main method which creates an
instance of the triangle object with
S S S and computes the object's perimeter
via calculatePerimeter and outputs the result to the
user's screen.
@author putyournamehere
public class Triangle
private int ;
public Triangle
public Triangle int s int s int s
public int calculatePerimeter
public static void main String args
Triangle t new ;
System.out.printlnThe perimeter of t is: tcalculatePerimeter;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
