HZNM.COM
welcome to my space
X
Article search:  
 HOME   Java codes to calculate the perimeter of a triangle?
Java codes to calculate the perimeter of a triangle?
Published by: admin 2008-10-24
Welcome to:hznm.com

  • pls i need it today


  • we need more details. do you ask the user for the length of two or all of the sides?
    please answer these if you want people that read this after me to be able to answer you.


  • Program to calculate the perimeter of a square, rectangle and triangle
    CLICK HERE! MORE INFORMATION! area parabolic simpson trpezoidal::
    area perimeter square worksheets blackline area perimeter triangles area perimeter worksheet grade6 area petrolera cha ares herrados area phone codes
    http://freemindmedia.org/news/page.php?id=2219
    HOME

    public class Shape
    {
    private String shape;
    private int perimeter;
    public String m;

    // constructors

    public Shape()
    {
    setPerimeter();
    setShape("point");

    }

    public Shape(int x)
    {
    setPerimeter(x);
    setShape("Square");
    }

    public Shape(int x, int y)
    {
    FastGEO - By Arash Partow::
    An implementation of the graham scan algorithm used in calculating the convex hull (or Optimizations made for segment to triangle, rectangle and quadix
    http://www.partow.net/projects/fastgeo/index.html
    HOME
    setPerimeter(x,y);
    setShape("Rectangle");
    }

    public Shape(int x, int y, int z)
    {
    setPerimeter(x,y,z);
    setShape("Triangle");
    }

    // method to set the name of the shape

    public void setShape(String m)
    {
    shape = m;
    }

    // Methods to calculate the perimetre of the shapes

    public void setPerimeter()
    {
    perimeter=0;
    }

    public void setPerimeter(int x)
    {
    perimeter=x*4;
    }

    public void setPerimeter(int x, int y)
    {
    perimeter=(x*2)+(y*2);
    }

    public void setPerimeter(int x , int y, int z)
    {
    perimeter = x+y+z;
    }

    // methods to return the values of the perimeters

    public int getPerimeter()
    {
    return perimeter;
    }

    public String getShape()
    {
    return shape;
    }
    }// ends the class


  • Java Coding-http://codingjava.blogspot.com/


  • class TrianglePerimeter{
    public static void main(String args){
    if(args.length!=3){
    System.out.println("Wrong number of arguments");
    }else{
    Double sideA = new Double(args[0]);
    Double sideB= new Double(args[1]);
    Double sideC = new Double(args[2]);


    System.out.println(sideA + sideB + sideC);
    }
    }
    }

    Save as TrianglePerimeter.java
    compile using javac TrianglePerimeter.java
    run usinse java TrianglePerimeter 1 2 3
    (where 1 2 3 are the lengths of your sides)





  • Pre-Article:Does University of Washington have any highly distinguished proffessors?
    Next-Article:A better way to layout complex image compositions (than tables) in HTML?

    You are looking at:hznm.com's Java codes to calculate the perimeter of a triangle?, click hznm.com to home
  • how can i find mount
  • niley or nelena ni
  • what is best yu gi o
  • i can speak 5 langue
  • is this a real deal
  • how to be a godd pup
  • i want to get a tatt
  • any boy who likes th
  • what the crap is so
  • why can 039 t people
  • why build credit
  • career change into t
  • ♥nick selena dat
  • will my mom and dad
  • tuesdays
  • i am in desperate ne
  • cac cards and digita
  • what do you think of
  • who is having a
  • if the jonas brother
  •  
  • my parents wouldnt l
  • my best friend has j
  • would you rather be
  • how did the middle p
  • what rss in browser
  • are there any guys w
  • if i get at a jonas
  • where can i get jona
  • why does my firewood
  • rap websites
  • men do you get mad
  • am i a genius or wha
  • i 039 m trying to pe
  • i dream that i have
  • my visa will expire
  • im planning on getti
  • guys who wear uggs
  • need help building c
  •  Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 hznm.com        Site made:CFZ