@@ -0,0 +1,1100 @@
+package ru.nivanov;%0A%0Aimport static java.lang.Math.*;%0A%0Apublic class Square %7B%0A%09%0A%09int a;%0A%09int b;%0A%09int c;%0A%09%0A%09public Square (int a, int b, int c) %7B%0A%09this.a = a;%0A%09this.b = b;%0A%09this.c = c;%0A%0A%09%7D%0A%09%0A%09void calculating () %7B%0A%09%09%0A%09%09Square square = new Square (a, b, c);%0A%09%09%0A%09%09// Calculate diskriminant and check is solution exists%0A%09%09%0A%09%09float diskr = (float)(Math.pow((this.b),2) - 4 * this.a * this.c);%0A%09%09%0A%09%09if (diskr %3C 0.00) %7B%0A%09%09%09System.out.println(%22No solution%22);%0A%09%09%09%09%09%7D%0A%09%09%09%09%09%09%09%0A%09%09else %7B%0A%09%09%09%0A%09%09%09float x1 = (float) ((-this.b + sqrt(diskr))/(2 * this.a));%0A%09%09%09float x2 = (float) ((-this.b - sqrt(diskr))/(2 * this.a));%0A%09%09%09float step = (float) (-0.1);%0A%09%09%09%0A%09%09%09while ( x1 %3E x2 ) %7B%0A%09%09%09%09%09float result = square.calculate (x1);%0A%09%09%09%09%09square.show (x1, x2, step, result);%0A%09%09%09%09%09x1 = x1 + step;%0A%09%09%09%09%7D%0A%09%09%09%09%0A%09%09%09%09%7D%0A%09%09%7D%09%09%09%09%09%09%09%09%09%0A%09void show (float start, float finish, float step, float y) %7B%0A%09%09System.out.println(String.format (%22x1: %25.1fd, x2: %25.1fe, step: %25.1ff, Func y is: %25.1fg%22, start, finish, step, y));%0A%09%09%7D%0A%09float calculate (float x) %7B%0A%09%09float y = (float) (this.a * Math.pow((x),2) + this.b * x + this.c);%0A%09%09return y;%0A%09%09%7D%0A%09%09%0A%09%0A%7D%09

add Square