document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. //for http://kodyjava.blogspot.com/
  2.  
  3. class Funkcje{
  4. public static void show(double i){
  5. System.out.println("Liczba "+i+": sinus: "+Math.sin(i)+" abs :"+Math.abs(i));
  6. }
  7. public static void showLog(double i){
  8. System.out.println("Liczba "+i+": sinus: "+Math.sin(i)+" abs :"+Math.abs(i)+" log: "+Math.log(i));
  9. }
  10.  
  11. }
  12.  
  13.  
  14. class Start{
  15. final static double MIN = -5.0;
  16. final static double MAX = 10.0;
  17. final static double STEP = 0.5;
  18.  
  19.  
  20. public static void main(String[] argv ){
  21.  
  22. Funkcje f=new Funkcje();
  23.  
  24. for(double i=MIN;i<=MAX;i=i+STEP){
  25.  
  26. if(i<0){
  27.  
  28. f.show(i);
  29.  
  30. }
  31. else{
  32.  
  33. System.out.println("---------------------");
  34. if(i==0)
  35. f.show(i);
  36. else
  37. f.showLog(i);
  38. if(i<=MAX-STEP)
  39. f.showLog(i=i+STEP);}
  40. }
  41.  
  42.  
  43. }
  44. }
');