Medior
19 augustus 2026Vind de bug: Flutter
Eén stukje code. Vind de bug, of bewijs dat er geen is.
dart
1class PriceCalculator {
2 List<double> applyDiscount(List<double> prices, double discount) {
3 for (int i = 0; i < prices.length; i++) {
4 prices[i] = prices[i] * (1 - discount);
5 }
6 return prices;
7 }
8}
9
10void main() {
11 final original = [10.0, 20.0, 30.0];
12 final calc = PriceCalculator();
13 final discounted = calc.applyDiscount(original, 0.1);
14 print(original);
15}Klik op de regels die het probleem veroorzaken.
Jouw oordeel
Eén poging per dag. Het antwoord verschijnt direct daarna.
Behoud je reeks
Maak een account om je reeks te behouden en je voortgang te volgen.