Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class UE3_3_class {
- public static double a;
- public static double b;
- public static double x;
- public static double sprungweite = 0.5;
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- System.out.println("Geben Sie a ein");
- a = sc.nextDouble();
- System.out.println("Geben Sie b ein");
- b = sc.nextDouble();
- for (boolean i = false; i == false; x = x + sprungweite) {
- if (a * x + b == 0) {
- i = true;
- } else {
- i = false;
- }
- }
- System.out.println("x=" + (x - sprungweite));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement