BaşlayınÜcretsiz Başlayın

Batch Checking

You are responsible for the quality checking of different batches of chocolate boxes. You are aware that one is too heavy, but you don't know which one. Print them out in order to find out which one is above 220g.

Bu egzersiz

Intermediate Java

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Use the correct symbol to mark the difference between the elements and the collection.
  • Call the proper variable to print how much each batch weighs.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

class WeightWatcher {
  public static void main(String[] args) {
    int[] weights = {198, 190, 188, 187, 190, 198, 201, 250, 203, 210, 205, 170, 180, 200, 203, 210, 180};

    // Use the correct symbol to mark the difference between the elements and the collection
    for (int weight ____ weights){
      // Call the right variable to print how much each batch weighs
      System.out.println(____);
    }
  }
}
Kodu Düzenle ve Çalıştır