No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

NumberCruncher

Lisez d'abord l'énoncé, et essayez de résoudre l'exercice. Ensuite vous pouvez utiliser la boîte de sélection afin d'afficher le code correspondant.

Enoncé

Nous devons créer une classe NumberCruncher avec les méthodes suivantes :

  • Une méthode Multiple, appliquée à deux entiers, qui renvoit true si le second est un multiple du premier.
  • Une méthode qui affiche la table de valeurs du carré et du cube des nombres de 1 à 10 de la manière suivante :

    numbersquarecube
    000
    111
    248
    3927
    41664
    525125
    636216
    749343
    864512
    981729
    101001000
  • Une méthode qui affiche la table des 30 premiers entiers, ainsi que leurs représentations binaire, octale, et hexadécimale.
  • Une méthode affiche la somme des entiers pairs de 2 à 30.
  • Une méthode qui affiche le produit des entiers impairs de 1 à 15.

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 15/05/2005, last modified the 08/08/2019
Source of the printed document:https://www.gaudry.be/en/javaex-rf-NumberCruncher.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.