Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args)
- {
- Student[] studenci = new Student[3];
- Scanner skaner = new Scanner (System.in);
- String nazwisko;
- String imie;
- long album;
- int rok;
- double srednia;
- for(int i=0; i<studenci.length;i++){
- System.out.println("Podaj nazwisko");
- nazwisko = skaner.next();
- System.out.println("Podaj imie");
- imie = skaner.next();
- System.out.println("Podaj nr albumu");
- album = skaner.nextLong();
- System.out.println("Podaj rok");
- rok = skaner.nextInt();
- System.out.println("Podaj srednia");
- srednia = skaner.nextDouble();
- skaner.close();
- studenci[i] = new Student(nazwisko, imie, album, rok, srednia);
- }
- System.out.println("------------------------------------------------------------------");
- System.out.println("I Nazwisko I Imie I Album I Rok I Srednia I");
- System.out.println("------------------------------------------------------------------");
- for(int i=0; i<studenci.length;i++)
- {
- studenci[i].wyswietl();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement