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

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

OEResource: Update resource with id: 1ae9846a-15b6-4cc7-bd9a-1e516980aca9

parents
Branches
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
```
audience: Advanced Beginners
creator:
- affiliation: Technische Universität Wien
email: stefan.podlipnig@tuwien.ac.at
name: Stefan Podlipnig
- affiliation: Technische Universität Wien
email: nadja.jovancevic@tuwien.ac.at
name: Nadja Jovancevic
description: "Es wird ein Array von Ganzzahlen entgegengenommen, das die Noten einer\
\ Klasse darstellt. Die Noten werden in folgende Kategorien eingeteilt: 'A' (90-100),\
\ 'B' (80-89), 'C' (70-79), 'D' (60-69), 'F' (<60). Es wird die Anzahl der Noten\
\ in jeder Kategorie ausgegeben.\r\n\r\nEntwickelt mit Unterstützung von ChatGPT\
\ 4."
difficulty: easy
format:
- md
keyword:
- Switch conditionals
language:
- de
learningResourceType: Programming exercise
license: CC BY 4.0
metadataVersion: '0.5'
programmingLanguage:
- Java
publisher:
- affiliation: Technische Universität Wien
email: nadja.jovancevic@tuwien.ac.at
name: Nadja Jovancevic
teaches:
- Java/Controlflow/Conditionals/Switch Statements
timeRequired: < 15 min
title: Notenstatistik
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