add simple GUI
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user