/* * 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 { /** * @param args the command line arguments */ public static void main(String[] args) { double a=0,b=0,c=0,d=0; double[] x = new double[3]; try{ Scanner in= new Scanner(System.in); 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(a,b,c,d)); }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; }; class Rkw{ public double delta(double a, double b, double c, double d) { d=Math.pow(b, 2)-4*a*c; return d; }; } }