Skip to content

Commit

Permalink
jv-oop-advanced task is done
Browse files Browse the repository at this point in the history
  • Loading branch information
serhii-slobodianiuk committed Nov 11, 2024
1 parent 3b03b22 commit cb15c81
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/main/java/core/basesyntax/HelloWorld.java

This file was deleted.

20 changes: 20 additions & 0 deletions src/main/java/core/basesyntax/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package core.basesyntax;

import core.basesyntax.model.AreaCalculator;
import core.basesyntax.model.Circle;
import core.basesyntax.model.Figure;

/**
* Feel free to remove this class and create your own.
*/
public class HelloWorld {
public static void main(String[] args) {

System.out.print(String.format("%s. Color: %s. ", this.getClass().getSimpleName(), color));
final int amountFigures = 6;
final int HALF_FIGURES_COUNT = 3;
AreaCalculator figure = new Circle();
figure.setColor("");
figure.getArea();
}
}
8 changes: 8 additions & 0 deletions src/main/java/core/basesyntax/model/Circle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package core.basesyntax;

public class Circle extends Figure {
@Override
public void draw() {
System.out.println("Circle");
}
}
4 changes: 4 additions & 0 deletions src/main/java/core/basesyntax/model/Color.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package core.basesyntax.model;

public enum Color {
}
9 changes: 9 additions & 0 deletions src/main/java/core/basesyntax/model/Figure.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package core.basesyntax;

import java.awt.*;

public abstract class Figure {
String color;

public abstract void draw();
}
8 changes: 8 additions & 0 deletions src/main/java/core/basesyntax/model/IsoscelesTrapezoid.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package core.basesyntax;

public class IsoscelesTrapezoid extends Figure implements Drawable {
@Override
public void draw() {
System.out.println("Isosceles Trapezoid");
}
}
8 changes: 8 additions & 0 deletions src/main/java/core/basesyntax/model/Rectangle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package core.basesyntax;

public class Rectangle extends Figure implements Drawable {
@Override
public void draw() {
System.out.println("Drawing a rectangle");
}
}
8 changes: 8 additions & 0 deletions src/main/java/core/basesyntax/model/RightTriangle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package core.basesyntax;

public class RightTriangle extends Figure implements Drawable {
@Override
public void draw() {
System.out.println("Right Triangle");
}
}
8 changes: 8 additions & 0 deletions src/main/java/core/basesyntax/model/Square.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package core.basesyntax;

public class Square extends Figure implements Drawable {
@Override
public void draw() {
System.out.println("Square");
}
}
7 changes: 7 additions & 0 deletions src/main/java/core/basesyntax/service/AreaCalculator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package core.basesyntax.model;

public interface AreaCalculator {
String color = "";

void getArea();
}
4 changes: 4 additions & 0 deletions src/main/java/core/basesyntax/service/ColorSupplier.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package core.basesyntax.service;

public class ColorSupplier {
}
4 changes: 4 additions & 0 deletions src/main/java/core/basesyntax/service/Drawable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package core.basesyntax.service;

public interface Drawable {
}
4 changes: 4 additions & 0 deletions src/main/java/core/basesyntax/service/FigureSupplier.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package core.basesyntax.service;

public class FigureSupplier {
}

0 comments on commit cb15c81

Please sign in to comment.