This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 74a78105 authored by OEResource sharing's avatar OEResource sharing
Browse files

Update file Notenstatistik.md for resource with id: 1ae9846a-15b6-4cc7-bd9a-1e516980aca9

parent 4b78750a
No related merge requests found
## Notenstatistik
#### Aufgabenstellung:
Implementieren Sie eine Methode `calculateGradesStatistics`:
- `static void calculateGradesStatistics(int[] grades)`
Diese Methode nimmt ein Array von Ganzzahlen (`grades`) entgegen, das die Noten einer Klasse darstellt. Verwenden Sie eine `switch`-Anweisung, um die Noten in folgende Kategorien einzuteilen: 'A' (90-100), 'B' (80-89), 'C' (70-79), 'D' (60-69), 'F' (<60). Die Methode soll die Anzahl der Noten in jeder Kategorie ausgeben.
**Vorbedingungen:** Alle Elemente in `grades` sind zwischen 0 und 100.
#### Beispiele:
```java
calculateGradesStatistics(new int[]{95, 85, 72, 60, 48, 88, 92}) -->
A: 2
B: 2
C: 1
D: 1
F: 1
calculateGradesStatistics(new int[]{91, 25, 32, 66, 78, 83, 62}) -->
A: 1
B: 1
C: 1
D: 2
F: 2
calculateGradesStatistics(new int[]{100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0}) -->
A: 2
B: 1
C: 1
D: 1
F: 6
calculateGradesStatistics(new int[]{61, 71, 81, 91}) -->
A: 1
B: 1
C: 1
D: 1
F: 0
```
## Notenstatistik
#### Aufgabenstellung:
Implementieren Sie eine Methode `calculateGradesStatistics`:
- `static void calculateGradesStatistics(int[] grades)`
Diese Methode hat ein Array `grades` von Ganzzahlen, das die Noten einer Klasse darstellt. Verwenden Sie eine `switch`-Anweisung, um die Noten in folgende Kategorien einzuteilen: 'A' (90-100), 'B' (80-89), 'C' (70-79), 'D' (60-69), 'F' (<60). Die Methode gibt die Anzahl der Noten in jeder Kategorie aus.
**Vorbedingung(en):** `grades != null` und alle Elemente in `grades` sind zwischen `0` und `100`.
#### Beispiel(e):
```java
calculateGradesStatistics(new int[]{95, 85, 72, 60, 48, 88, 92}) -->
A: 2
B: 2
C: 1
D: 1
F: 1
calculateGradesStatistics(new int[]{91, 25, 32, 66, 78, 83, 62}) -->
A: 1
B: 1
C: 1
D: 2
F: 2
calculateGradesStatistics(new int[]{100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0}) -->
A: 2
B: 1
C: 1
D: 1
F: 6
calculateGradesStatistics(new int[]{61, 71, 81, 91}) -->
A: 1
B: 1
C: 1
D: 1
F: 0
```
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment