1
0

add simple GUI

This commit is contained in:
Joel Baldauf
2020-12-09 15:03:39 +01:00
parent f99dc5e78a
commit 9711ac4e32
2 changed files with 131 additions and 0 deletions
+21
View File
@@ -25,7 +25,28 @@ public class PunkteInNoten {
else
System.out.printf("%d Punkte %d%%\n", point, pointPercentage);
}
}
public static String[][] calculateMarks (int maxPoints, int totalPercentage) {
int pointPercentage = 0;
double markIHK = 0.0;
String[][] output = new String[maxPoints+1][4];
for (int point=maxPoints; point>=0; point--) {
pointPercentage = (int) (((double)point/(double)maxPoints)*(double)totalPercentage);
markIHK = marksIHK[pointPercentage];
if (totalPercentage == 100) {
output[maxPoints-point][0] = Integer.toString(point);
output[maxPoints-point][1] = Integer.toString(pointPercentage) + " %";
output[maxPoints-point][2] = Double.toString(markIHK);
output[maxPoints-point][3] = Integer.toString((int)markIHK);
}
else {
output[maxPoints-point][0] = Integer.toString(point);
output[maxPoints-point][1] = Integer.toString(pointPercentage) + " %";
}
}
return output;
}
}