/* * 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 zadanie1; import java.util.Scanner; /** * * @author Adam6560b */ public class Zadanie1 { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here double a,b,c; double[] t = new double[10]; //String napis; c=0; String czypowt="T"; do{ try{ // TODO code application logic here Scanner in = new Scanner(System.in); new Kalkulator(); System.out.print("dawaj liczbe 1: "); a= in.nextDouble(); System.out.print("dawaj liczbe 2: "); b= in.nextDouble(); System.out.print("wynik..........." ); System.out.println(Kalkulator.dodawanie(a,b,c)); System.out.print("T- powtórz obliczenia"); czypowt= in.next(); }catch (Exception ex){ System.out.println("zle dane!!!11!"); } }while(czypowt.equals("T")); } } class Kalkulator { //public Kalkulator(double a, double b) static double dodawanie(double a, double b,double c) { c=a+b; return c; } }