Skip to content

Commit

Permalink
initial java commit
Browse files Browse the repository at this point in the history
  • Loading branch information
akramsyed0338 committed Apr 26, 2017
1 parent b00cbe6 commit 35f8c04
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bin/*
dist/*
reports/*
docs/*

Empty file added jenkinsfile
Empty file.
18 changes: 18 additions & 0 deletions src/Rectangle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
public class Rectangle{
public int length;
public int width;

public Rectangle ( int length, int width) {
this.length = length;
this.width = width;
}
public int getArea() {
return length * width;

}

public int getPerimeter () {
return 2 * ( length + width);

}
}
13 changes: 13 additions & 0 deletions src/Rectangular.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
public class Rectangulator {
public static void main (String[] args) {
int length = Integer.parseInt(args[0]);
int width = Integer.parseInt(args[1]);

Rectangle myRectangle = new Rectangle(length, width);
String output = String.format ("*** Your Rectangle ***\n\nLength: %d\nWidth: %d\nArea: %d\nPerimeter %d\n\n", myRectangle.length, myRectangle.width, myRectangle.getArea(), myRectangle.getPerimeter();)

System.out.println(output);

}

}

0 comments on commit 35f8c04

Please sign in to comment.