1
0

output Umordnung

This commit is contained in:
Joel Baldauf
2020-12-11 16:37:10 +01:00
parent 5fd0ee406e
commit 09dbfc9660
+11 -5
View File
@@ -119,7 +119,7 @@ public class frame extends JFrame {
res[1] = String.format("%.2f", percentagePartB);
res[2] = String.format("%.2f", totalPercentage);
res[3] = String.format("%.0f", totalPercentage);
res[4] = String.format("%.2f", markIHK);
res[4] = String.format("%.1f", markIHK);
res[5] = String.format("%.0f", markIHK);
return res; //Rückgabe der Ergebnisse als Array
}
@@ -144,6 +144,15 @@ public class frame extends JFrame {
return totalPercentage; //Rückgabe der gesamten erreichten Prozente
}
//Methode für das Zusammenbauen der Ausgabe für AP1
public String buildOutString (String title, String[] res, JSpinner spPartA, JSpinner spPartB) {
String out = String.format("%s \n\nAnzahl der richtig gelösten gebundenen Aufgaben %d:0,5 = %s"
+ "Erreichte Punkte bei den ungebundenen Aufgaben %d:1,6 = %s\n"
+ "Ergebnis in Punkten (max.100) \t%s \n \t\t\t%s\n"
+ "IHK-Note:%s\nganze Note:%s", title, (int)spPartA.getValue(), res[0], (int)spPartB.getValue(), res[1], res[2], res[3], res[4], res[5]);
return out;
}
/**
* Create the frame.
*/
@@ -334,10 +343,7 @@ public class frame extends JFrame {
public void actionPerformed(ActionEvent e) {
String[] resWiso = calculatePart((int)spAP1_PartA.getValue(), (int)spAP1_PartB.getValue(), pointsAP1PartA, pointsAP1PartB, 50, 50);
JTextPane txtpnGesamt = new JTextPane();
txtpnGesamt.setText("AP1 \n\nAnzahl der richtig gelösten gebundenen Aufgaben " + spAP1_PartA.getValue() + ": 0,5 = " + resWiso[0] + "\n"
+ "Erreichte Punkte bei den ungebundenen Aufgaben " + spAP1_PartB.getValue() + ": 1,6 =" + resWiso[1] + "\n"
+ "Ergebnis in Punkten (max.100) \t" + resWiso[2] + "\n \t\t\t" + resWiso[3] + "\n"
+ "IHK-Note:" + resWiso[4] + "\nganze Note:" + resWiso[5]);
txtpnGesamt.setText(buildOutString("AP1", resWiso, spAP1_PartA, spAP1_PartB));
txtpnGesamt.setEditable(false);
txtpnGesamt.setBackground(getBackground());
scrollPane.setViewportView(txtpnGesamt);