From 7ea4bb107dcc61fe7d72fd94d7b005afacf05488 Mon Sep 17 00:00:00 2001 From: henrivajak Date: Mon, 29 May 2017 19:51:54 +0300 Subject: [PATCH] t08 alamklass --- Kasutus.class | Bin 0 -> 1103 bytes Kasutus.java | 32 ++++++++++++++++++++++++++++++++ Pindala.class | Bin 0 -> 268 bytes Pindala.java | 5 +++++ Romb.class | Bin 0 -> 110 bytes Romb.java | 3 +++ Umbermoot.class | Bin 0 -> 270 bytes Umbermoot.java | 5 +++++ 8 files changed, 45 insertions(+) create mode 100644 Kasutus.class create mode 100644 Kasutus.java create mode 100644 Pindala.class create mode 100644 Pindala.java create mode 100644 Romb.class create mode 100644 Romb.java create mode 100644 Umbermoot.class create mode 100644 Umbermoot.java diff --git a/Kasutus.class b/Kasutus.class new file mode 100644 index 0000000000000000000000000000000000000000..34f4b189b73edf54c2f172f22f8ab4e86458da8e GIT binary patch literal 1103 zcmaJ=TT|0O6#ljiO&Y?jPk+JFwRLw~!= z^TL6%PXjpR%73f{PMIMh2R+mpv+y%pUL_1@(he_Y8B*4{0r><`Kcs@~#9exvc4D&G zo9dl%6Ss;4xw7GL;f{y(oDYHRhs`aZC9!E|c%|ZaMTY6~ays_oc$7q5k@I0-Z>ff5 z+qNur$+FY`NznqowPg&0RwpovF^te}BEJZjTs1mJ$+}FEk?fi{0{cP=wW2fDbVd;; zz!lOZ^fy^L$9OJ|| cjc&|RYymx3K`%BaDlmXgNYc%&QceWsUqM~{9RL6T literal 0 HcmV?d00001 diff --git a/Kasutus.java b/Kasutus.java new file mode 100644 index 0000000..ea9147a --- /dev/null +++ b/Kasutus.java @@ -0,0 +1,32 @@ +import java.util.*; + +public class Kasutus{ + public static void main(String[] arg){ + Romb pindala = new Pindala(); + Romb umbermoot = new Umbermoot(); + Scanner scanning = new Scanner(System.in); + + System.out.println("\nSisesta rombi külg: "); + double a=scanning.nextDouble(); + System.out.println("Sisesta rombi 1 diagonaal: "); + double d1=scanning.nextDouble(); + System.out.println("Sisesta rombi 2 diagonaal: "); + double d2=scanning.nextDouble(); + + System.out.println("\nRombi pindala on " + pindala.f(d1,d2,a)); + System.out.println("Rombi umbermoot on " + umbermoot.f(a,d1,d2)); + + } +} + + /* + Sisesta rombi külg: +3 +Sisesta rombi 1 diagonaal: +4 +Sisesta rombi 2 diagonaal: +5 + +Rombi pindala on 10.0 +Rombi umbermoot on 12.0 + */ \ No newline at end of file diff --git a/Pindala.class b/Pindala.class new file mode 100644 index 0000000000000000000000000000000000000000..eb184dc34577edcc989e70e666518a01551fc7f8 GIT binary patch literal 268 zcmZ8bJx>Bb6r6X!Ey4+iwj@%)Q9wgUj0qPj14Ib@9xP_h`$!1*w}_RA1wX(aWtcTq zZZWfO-n@D5`{(NnV2s-uDrowTEZkFQDcmTu1^&e5_V6Gm^~1HGJT10H(0sPJnH{s( z>{mKYsmPAreiTJvB&aQm<9=hFtm^~|n{RchhlzgI0kf+D^`{A1P93E>e;v)^#B2`S z@ls?lx+wD|hVmYd%sJu}s}5PnmBA?Q`uT58- HnuW$6O))8A literal 0 HcmV?d00001 diff --git a/Umbermoot.java b/Umbermoot.java new file mode 100644 index 0000000..bc3b19e --- /dev/null +++ b/Umbermoot.java @@ -0,0 +1,5 @@ +public class Umbermoot implements Romb{ + public double f(double a, double d1, double d2){ + return 4*a; + } +} \ No newline at end of file