/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package zadanie2; import java.util.Scanner; /** * * @author Adam6560b */ public class Zadanie2 { static double a=0,b=0,c=0,d=0; static Scanner in= new Scanner(System.in); /** * * @param args the command line arguments */ public static void main(String[] args) { double[] x = new double[3]; try{ System.out.print("podaj a: "); a=in.nextDouble(); System.out.print("podaj b: "); b=in.nextDouble(); System.out.print("podaj c: "); c=in.nextDouble(); System.out.println(Rkw.delta()); }catch(Exception ex){ System.out.println("Złe dane"); }finally{ System.out.println("koniec obliczen"); } } public double miejscazerowe(double d){ if(d>0){} return d; } public static class Rkw{ public static double delta() { d=Math.pow(b, 2)-4*a*c; return d; } } }