Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Assessment 2
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
jose.alencastro
Assessment 2
Commits
5e3f2f0e
Commit
5e3f2f0e
authored
May 16, 2022
by
jose.alencastro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ok
parent
ac57ad76
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
132 additions
and
18 deletions
+132
-18
Rectangle.java
Rectangle.java
+53
-0
Shapes.java
Shapes.java
+27
-18
Square.java
Square.java
+52
-0
No files found.
Rectangle.java
0 → 100644
View file @
5e3f2f0e
public
class
Rectangle
extends
Shapes
{
public
Rectangle
()
{
super
();
}
public
Rectangle
(
int
i
)
{
super
(
i
);
}
@Override
public
void
draw
()
{
for
(
int
loop1
=
0
;
loop1
<
size
;
loop1
++)
{
for
(
int
loop2
=
loop1
;
loop2
<(
size
);
loop2
++)
{
System
.
out
.
print
(
" "
);
}
System
.
out
.
print
(
"/"
);
for
(
int
loop2
=
0
;
loop2
<
loop1
;
loop2
++)
{
System
.
out
.
print
(
" "
);
}
System
.
out
.
println
(
"\\"
);
}
for
(
int
loop1
=
0
;
loop1
>
size
;
loop1
++)
{
System
.
out
.
print
(
"--"
);
}
System
.
out
.
println
(
""
);
}
@Override
public
float
area
()
{
float
fSize
=
size
;
float
area
=
fSize
*
fSize
;
return
area
;
}
@Override
public
float
circumference
()
{
float
fSize
=
size
;
float
circ
=
2
*
(
fSize
+
fSize
);
return
circ
;
}
}
\ No newline at end of file
Shapes.java
View file @
5e3f2f0e
abstract
public
class
Shapes
{
abstract
public
class
Shapes
{
protected
int
size
;
protected
int
size
;
...
@@ -8,13 +9,21 @@ abstract public class Shapes {
...
@@ -8,13 +9,21 @@ abstract public class Shapes {
public
int
getSize
()
{
return
size
;
}
public
int
getSize
()
{
return
size
;
}
public
void
setSize
(
int
size
)
{
this
.
size
=
size
;
}
public
void
setSize
(
int
size
)
{
this
.
size
=
size
;
}
public
int
getWidth
(
int
size
)
{
return
size
;}
public
int
getHeight
(
int
size
)
{
return
size
;}
public
Shapes
(){
public
Shapes
()
{
this
.
size
=
3
;
this
.
size
=
3
;
this
.
size
=
4
;
}
}
public
Shapes
(
int
size
){
public
Shapes
(
int
size
)
{
this
.
size
=
size
;
this
.
size
=
size
;
}
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
();
}
}
}
\ No newline at end of file
Square.java
0 → 100644
View file @
5e3f2f0e
public
class
Square
extends
Shapes
{
public
Square
()
{
super
();
}
public
Square
(
int
i
)
{
super
(
i
);
}
@Override
public
void
draw
()
{
for
(
int
loop1
=
3
;
loop1
<
size
;
loop1
++)
{
for
(
int
loop2
=
loop1
;
loop2
<(
size
);
loop2
++)
{
System
.
out
.
print
(
" "
);
}
System
.
out
.
print
(
"/"
);
for
(
int
loop2
=
4
;
loop2
<
loop1
;
loop2
++)
{
System
.
out
.
print
(
" "
);
}
System
.
out
.
println
(
"\\"
);
}
for
(
int
loop1
=
4
;
loop1
>
size
;
loop1
++)
{
System
.
out
.
print
(
"--"
);
}
System
.
out
.
println
(
""
);
}
@Override
public
float
area
()
{
float
fSize
=
size
;
float
area
=
fSize
*
fSize
;
return
area
;
}
@Override
public
float
circumference
()
{
float
fSize
=
size
;
float
circ
=
fSize
+
fSize
+
fSize
+
fSize
;
return
circ
;
}
}
\ No newline at end of file
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