Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class domy {
- static int zwieksz(String stare, String nowe) throws FileNotFoundException {
- int bezzmian=0;
- File dane = new File(stare);
- PrintWriter nowy = new PrintWriter(nowe);
- Scanner odczyt = new Scanner(dane);
- while(odczyt.hasNextLine()){
- String nazwa = odczyt.nextLine();
- int kond = Integer.parseInt(odczyt.nextLine());
- BigDecimal cena = new BigDecimal(odczyt.nextLine());
- if(kond==2) {
- bezzmian+=1;
- cena = cena.multiply(new BigDecimal(1.15));
- }
- nowy.println(nazwa+" "+kond+" "+cena);
- }
- nowy.close();
- return bezzmian;}
Add Comment
Please, Sign In to add comment