Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static double Plik(String nazwa, String nazwisko) throws IOException{
- String roz = nazwa + ".TXT";
- String wynik = nazwa + ".WYN";
- File plik = new File(roz);
- PrintWriter zapis = new PrintWriter(wynik);
- Scanner skan = new Scanner(System.in);
- double srsr = 0;
- while(skan.hasNextLine()){
- String nazw = skan.nextLine();
- int rok = Integer.parseInt(skan.nextLine());
- double srednia = Double.parseDouble(skan.nextLine());
- String plec = skan.nextLine();
- if(nazw.equals(nazwisko)){
- srsr = srednia;
- }
- if(rok <= 2 && plec.equals("K")){
- zapis.print(nazw + ".");
- zapis.println(srednia);
- }
- }
- return srsr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement