[JAVA] trigonometric functions and separators
- Pobierz link
- X
- Inne aplikacje
zaczynam nową serię z JAVA tutaj, bo w c/c++ nie chce mi sie pisać
- //for http://kodyjava.blogspot.com/
- class Funkcje{
- public static void show(double i){
- System.out.println("Liczba "+i+": sinus: "+Math.sin(i)+" abs :"+Math.abs(i));
- }
- public static void showLog(double i){
- System.out.println("Liczba "+i+": sinus: "+Math.sin(i)+" abs :"+Math.abs(i)+" log: "+Math.log(i));
- }
- }
- class Start{
- final static double MIN = -5.0;
- final static double MAX = 10.0;
- final static double STEP = 0.5;
- public static void main(String[] argv ){
- Funkcje f=new Funkcje();
- for(double i=MIN;i<=MAX;i=i+STEP){
- if(i<0){
- f.show(i);
- }
- else{
- System.out.println("---------------------");
- if(i==0)
- f.show(i);
- else
- f.showLog(i);
- if(i<=MAX-STEP)
- f.showLog(i=i+STEP);}
- }
- }
- }
- Pobierz link
- X
- Inne aplikacje
Komentarze
Prześlij komentarz