Facebook
From Scanty Duck, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 213
  1. import java.util.*;
  2. import java.util.concurrent.ThreadLocalRandom;
  3.  
  4. public class Main {
  5.  
  6.     public static void main(String[] args)
  7.     {
  8.         double rand_dub1 = ThreadLocalRandom.current().nextDouble(1000000.000);
  9.         double wynik;
  10.  
  11.         System.out.println("\n Wartość portfela wynosi " + rand_dub1);
  12.         System.out.println("\n Jaką kwątę chcesz pobrać?");
  13.  
  14.         Scanner skaner = new Scanner(System.in);
  15.         double kwota = skaner.nextDouble();
  16.  
  17.         wynik = rand_dub1 - kwota;
  18.  
  19.         System.out.println("\n Pozostała kwota w portfelu to: "+wynik);
  20.     }
  21.  
  22. }
  23.