| Gleichung.java |
1 /**
2 * 183.592 Programmierpraxis TU Wien WS2014/15 H.Moritsch
3 * Lösung der Gleichung ax + b = 0
4 */
5 public class Gleichung {
6 public static void main(String[] args) {
7
8 double a = 10.0;
9 double b = 1.5;
10
11 double x;
12
13 if ( a == 0.0 )
14
15 if ( b == 0.0 )
16 System.out.println("unendlich viele Lösungen");
17 else
18 System.out.println("keine Lösung");
19
20 else {
21 x = a / b;
22 System.out.println(x);
23 }
24
25 }
26 }
27