Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Arvutus.class
Binary file not shown.
15 changes: 15 additions & 0 deletions Arvutus.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import java.util.Scanner;

public class Arvutus{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
System.out.println("Sisesta silindri korgus: ");
double h=sc.nextDouble();

System.out.println("Sisesta silindri raadius: ");
double r=sc.nextDouble();

Liides pindala = new TaisPindala();
System.out.println("Silindri taispindala on: "+ pindala.arvutus(h, r));
}
}
Binary file added Liides.class
Binary file not shown.
3 changes: 3 additions & 0 deletions Liides.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public interface Liides{
public double arvutus(double x, double y);
}
Binary file added TaisPindala.class
Binary file not shown.
5 changes: 5 additions & 0 deletions TaisPindala.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class TaisPindala implements Liides{
public double arvutus(double h, double r){
return (2*Math.PI*Math.pow(r,2)) + (2*Math.PI*h);
}
}