Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2013
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class Main {
  5.  
  6. public static void main(String[] args)
  7. {
  8. Student[] studenci = new Student[3];
  9. Scanner skaner = new Scanner (System.in);
  10. String nazwisko;
  11. String imie;
  12. long album;
  13. int rok;
  14. double srednia;
  15. for(int i=0; i<studenci.length;i++){
  16. System.out.println("Podaj nazwisko");  
  17. nazwisko = skaner.next();  
  18. System.out.println("Podaj imie");
  19. imie = skaner.next();
  20. System.out.println("Podaj nr albumu");
  21. album = skaner.nextLong();
  22. System.out.println("Podaj rok");
  23. rok = skaner.nextInt();
  24. System.out.println("Podaj srednia");
  25. srednia = skaner.nextDouble();
  26. skaner.close();
  27. studenci[i] = new Student(nazwisko, imie, album, rok, srednia);
  28. }
  29. System.out.println("------------------------------------------------------------------");
  30. System.out.println("I Nazwisko            I Imie            I Album I Rok  I Srednia I");
  31. System.out.println("------------------------------------------------------------------");
  32. for(int i=0; i<studenci.length;i++)
  33. {
  34. studenci[i].wyswietl();
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement