Advertisement
polpoteu

JAVA Tabela przeliczania z pętlą

Oct 25th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. package e9.tabela.przeliczeniowa;
  2.  
  3. public class E9TabelaPrzeliczeniowa {
  4.  
  5. public static void main(String[] args) {
  6.  
  7. double c, s, j,m;
  8. System.out.println("Tabela przeliczników odległości");
  9. System.out.println("metry cale stopy jardy mile");
  10.  
  11. for (int i = 5; i <= 100; i+=5) {
  12. c=i*39.37;
  13. c*=100;
  14. c=Math.round(c);
  15. c/=100;
  16. s=i*3.28;
  17. s*=100;
  18. s=Math.round(s);
  19. s/=100;
  20. j=i*1.09;
  21. j*=100;
  22. j=Math.round(j);
  23. j/=100;
  24. m=i*0.00062;
  25. System.out.println(i+ " "+c+" "+s+" "+j+" "+m);
  26. }
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement