Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
Java Assessment
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
reece.french
Java Assessment
Commits
c8ebd393
Commit
c8ebd393
authored
May 16, 2022
by
reece.french
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
c9977b82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
Rectangle.java
Rectangle.java
+49
-0
No files found.
Rectangle.java
0 → 100644
View file @
c8ebd393
public
class
Rectangle
extends
Shape
{
public
Rectangle
()
{
super
();
}
//Assessment only specified 0 or 2 inputs, but unit testing required 1 input
public
Rectangle
(
int
a
){
super
(
a
);
}
public
Rectangle
(
int
i
,
int
j
)
{
super
(
i
,
j
);
}
@Override
public
float
area
()
{
float
area
=
width
*
height
;
return
area
;
}
@Override
public
float
circumference
()
{
float
circ
=
width
+
width
+
height
+
height
;
return
circ
;
}
@Override
public
void
draw
(){
for
(
int
i
=
0
;
i
<
width
;
i
++)
{
if
(
i
==
0
||
i
==
width
-
1
)
{
for
(
int
j
=
0
;
j
<
height
;
j
++)
{
System
.
out
.
print
(
"-"
+
" "
);
}
System
.
out
.
println
(
""
);
}
else
{
//else
for
(
int
j
=
0
;
j
<
height
;
j
++)
{
if
(
j
==
0
||
j
==
height
-
1
)
{
System
.
out
.
print
(
"|"
+
" "
);
}
else
{
System
.
out
.
print
(
" "
+
" "
);
}
}
System
.
out
.
println
(
""
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment