SHARE
TWEET

u

XB74ck Aug 14th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class UE3_3_class {
  4.  
  5.   public static double a;
  6.   public static double b;
  7.   public static double x;
  8.   public static double sprungweite = 0.5;
  9.  
  10.   public static void main(String[] args) {
  11.  
  12.     Scanner sc = new Scanner(System.in);
  13.  
  14.     System.out.println("Geben Sie a ein");
  15.     a = sc.nextDouble();
  16.  
  17.     System.out.println("Geben Sie b ein");
  18.     b = sc.nextDouble();
  19.  
  20.     for (boolean i = false; i == false; x = x + sprungweite) {
  21.  
  22.       if (a * x + b == 0) {
  23.         i = true;
  24.       } else {
  25.         i = false;
  26.       }
  27.     }
  28.  
  29.     System.out.println("x=" + (x - sprungweite));
  30.   }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top