Skip to content

Commit fad8f6c

Browse files
committed
Intial Java commit
1 parent 388b85c commit fad8f6c

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bin/*
2+
dist/*
3+
reports/*docs/*

jenkinsfile

Whitespace-only changes.

src/Rectangle.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
public class Rectangle
2+
{
3+
public int length;
4+
public int width;
5+
6+
public Rectangle(int Length, int width)
7+
{
8+
this.length=length;
9+
this.width=width;
10+
}
11+
public int getArea()
12+
{
13+
return length * width;
14+
}
15+
public int getPerimeter()
16+
{
17+
return 2* (length + width);
18+
}
19+
}

src/Rectangulator.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
public class Reactangulator
2+
{
3+
public static void main(String[] args)
4+
{
5+
int length=Integer.parseInt(args[0]);
6+
int width=Integer.parseInt(args[1]);
7+
Recatangle myRectangle= new Reactangle(length,width);
8+
String output = String.format("*** Your Reactangle ***\n\n Length: %d\n width: %d\n Area: %d\nPerimeter: %d\n\n",myRectangle.length,myRectangle.width,myRectangle.getArea(),myRectangle.getPerimeter());
9+
System.out.println(output);
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)