Advertisement
MaciekxD

Untitled

Mar 24th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.43 KB | None | 0 0
  1.  
  2.     public class main
  3.     {
  4.         int funkcja(String nazwa, String szukaneNazwisko)
  5.         {
  6.             String nowaNazwa;
  7.             String nowaNazwa1;
  8.             nowaNazwa=nazwa+".TXT";
  9.             nowaNazwa1=nazwa+".WYN";
  10.             String nazwisko;
  11.             int rokStudiow, rokLiczba;
  12.             double sredniaOcen;
  13.             double sredniaOcenDoZw;
  14.             char plec;
  15.            
  16.             try(BufferedReader nowy = new BufferedReader(new FileReader(nowaNazwa)))
  17.             {
  18.                try(BufferedWriter nowy1 = new BufferedWriter( new FileWriter(nowaNazwa1)))
  19.                {
  20.                    String linie;
  21.                    while((linie=nowy.readLine())!=null)
  22.                    {
  23.                       linie=nowy.readLine();
  24.                       if(linie==szukaneNazwisko)
  25.                       {
  26.                         sredniaOcenDoZw=sredniaOcen;
  27.                       }
  28.                       rokStudiow=Integer.parseInt(nowy.readLine());
  29.                       plec = linie.charAt(0);
  30.                       if(rokStudiow<=2 && plec='K')
  31.                       {
  32.                          
  33.                       }
  34.                    
  35.                    }
  36.                    
  37.                }
  38.                catch(IOException e){ e.getMessage();}  
  39.            
  40.              }
  41.             catch(IOException e){ e.getMessage();}  
  42.             return 0;
  43.         }
  44.        
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement