You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.0 KiB
Java
35 lines
1.0 KiB
Java
package com.company.mathe;
|
|
|
|
import java.util.Scanner;
|
|
|
|
public class pfFormel {
|
|
|
|
public static void main(String[] args) {
|
|
pqFormelRechner rechner = new pqFormelRechner();
|
|
Scanner scanner = new Scanner(System.in);
|
|
boolean bisStop = false;
|
|
|
|
|
|
|
|
while (bisStop == false) {
|
|
try {
|
|
System.out.println("Bitte geben sie die Werte für P und Q ein: ");
|
|
System.out.println("P: ");
|
|
String Pwert = scanner.nextLine().replace("-", "");
|
|
if (Pwert.equals("x")) {
|
|
bisStop = true;
|
|
return;
|
|
}
|
|
System.out.println("Q: ");
|
|
String Qwert = scanner.nextLine().replace("-", "");
|
|
System.out.println(rechner.berechnePQFormel(Double.parseDouble(Pwert), Double.parseDouble(Qwert)));
|
|
}
|
|
catch(Exception e) {
|
|
System.out.println("Math Error");
|
|
System.out.println("Versuchen sie erneut");
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|