Skip to content

Commit

Permalink
Integrate the array exercises into po4a properly (and refresh them)
Browse files Browse the repository at this point in the history
  • Loading branch information
mquinson committed Oct 6, 2011
1 parent 710705e commit ecc28db
Show file tree
Hide file tree
Showing 14 changed files with 381 additions and 42 deletions.
177 changes: 171 additions & 6 deletions lib/l10n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2011-10-06 23:58+0300\n"
"PO-Revision-Date: 2011-10-07 00:05+0200\n"
"POT-Creation-Date: 2011-10-07 00:42+0300\n"
"PO-Revision-Date: 2011-10-07 00:45+0200\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: \n"
Expand Down Expand Up @@ -9517,8 +9517,10 @@ msgid ""
"Given a string, return a new string made of every other char starting with "
"the first, so \"Hello\" yields \"Hlo\"."
msgstr ""
"Étant donné une chaîne de caractères, retournez une nouvelle chaîne formée en\n"
"prenant un caractère sur deux dans le paramètre, en commençant avec le premier\n"
"Étant donné une chaîne de caractères, retournez une nouvelle chaîne formée "
"en\n"
"prenant un caractère sur deux dans le paramètre, en commençant avec le "
"premier\n"
"caractère. Ainsi, \"Bonjour\" donne \"Bnor\"."

#. type: Content of: <h1>
Expand Down Expand Up @@ -9646,9 +9648,11 @@ msgid ""
"there is no () after <code>length</code>. An attribute is a sort of variable "
"embedded in another object (here, the array)."
msgstr ""
"Ensuite, souvenez vous que le nombre de cases d'un tableau peut être retrouvé\n"
"Ensuite, souvenez vous que le nombre de cases d'un tableau peut être "
"retrouvé\n"
"grâce à l'attribut <code>length</code>. Donc, si votre tableau s'appelle\n"
"<code>tableau</code>, sa taille sera <code>tableau.length</code>. Notez qu'il\n"
"<code>tableau</code>, sa taille sera <code>tableau.length</code>. Notez "
"qu'il\n"
"n'y a pas de () après <code>length</code>. Un attribut est une sorte de\n"
"variable embarquée dans un autre objet (ici, le tableau)."

Expand All @@ -9659,3 +9663,164 @@ msgid ""
msgstr ""
"Donc, la dernière valeur d'un tableau est donnée par <code>tab[tab.length -1]"
"</code>."

#. type: Content of: <h1>
#: src/lessons/welcome/array/AverageValue.html:1
msgid "Average value"
msgstr "Valeur moyenne"

#. type: Content of: <p>
#: src/lessons/welcome/array/AverageValue.html:4
msgid ""
"The objective of this exercise is to compute the average value of the "
"integer values stored in an array."
msgstr ""
"L'objectif de cet exercice est de calculer la valeur moyenne d'un tableau de "
"valeur entière."

#. type: Content of: <p>
#: src/lessons/welcome/array/AverageValue.html:6
msgid ""
"You have to fill the body of the method <code>average(int[] tab)</code> "
"which takes as parameter the array of integers of which it computes and "
"returns the average value. Please note that the return type of the method "
"has type <code>int</code>."
msgstr ""
"Vous devez donc remplir le corps de la méthode <code>average(int[] tab)</"
"code> qui prend en paramètre le tableau, et qui retourne en résultat la "
"valeur moyenne. Notez bien que le résultat de cette méthode est de type "
"<code>int</code>"

#. type: Content of: <p>
#: src/lessons/welcome/array/AverageValue.html:8
msgid ""
"To compute the average value of an integer, it is necessary to traverse the "
"whole array and to compute the sum of all its values (so you will need a "
"variable to store this temporary result), then you have to divide this sum "
"by the size of the array. In Java, you can get the size of an array "
"<code>myarray</code> by consulting its <code>length</code> attribute (in "
"other words, <code>myarray.length</code>)."
msgstr ""
"Pour calculer la valeur moyenne d'un tableau, il faut parcourir l'ensemble "
"des valeurs du tableau, en faire la somme (vous aurez donc besoin d'une "
"variable pour conserver le résultat intermédiaire), puis diviser cette somme "
"par le nombre de valeur contenu dans le tableau. On vous rappelle que vous "
"pouvez obtenir la taille d'un tableau <code>montableau</code> en consultant "
"la valeur de l'attribut <code>length</code> de ce tableau (autrement dit "
"<code>montableau.length</code>)."

#. type: Content of: <h1>
#: src/lessons/welcome/array/IndexOfMaxValue.html:1
msgid "Index of the maximum value"
msgstr "Indice de la valeur maximale"

#. type: Content of: <p>
#: src/lessons/welcome/array/IndexOfMaxValue.html:3
msgid ""
"In this exercise, you must compute the indice of the tab cell containing the "
"biggest value."
msgstr ""
"Dans cet exercice, vous devez calculer l'indice de la case contenant la "
"plus\n"
"grande valeur du tableau."

#. type: Content of: <p>
#: src/lessons/welcome/array/IndexOfMaxValue.html:5
msgid ""
"For that, fill the <code>indexOfMaximum(int[] tab)</code> method. Its "
"parameter is the array to explore. Should the array contain the searched "
"value several times, you should return the indice of the first occurrence."
msgstr ""
"Pour cela, remplissez la méthode <code>indexOfMaximum(int[] tab)</code> dont "
"le\n"
"paramètre est le tableau à explorer. Si jamais la plus grande des valeurs "
"du\n"
"tableau est répétée plusieurs fois, votre méthode doit renvoyer la position "
"de\n"
"la première occurence."

#. type: Content of: <p>
#: src/lessons/welcome/array/IndexOfMaxValue.html:9
msgid ""
"To solve this exercise, you should sweep over the whole array. For each "
"value, if it's bigger than the biggest value you saw so far, you must save "
"this new champion and its position. You will thus need 2 extra variables; "
"the initial value of the champion could be the value of the first cell."
msgstr ""
"Pour résoudre cet exercice, vous devez parcourir le tableau. Pour chaque "
"case,\n"
"si sa valeur est plus grande que la plus grande des valeurs que vous avez\n"
"rencontré jusque là, sauvegardez cette nouvelle championne et sa position. "
"Il\n"
"vous faut donc deux nouvelles variables; la valeur initiale de la "
"championne\n"
"pourrait être la valeur rangée dans la première case."

#. type: Content of: <h1>
#: src/lessons/welcome/array/MaxValue.html:1
msgid "Maximal value"
msgstr "Valeur maximale"

#. type: Content of: <p>
#: src/lessons/welcome/array/MaxValue.html:3
msgid ""
"In this exercise, you must compute the maximal value contained in an array. "
"For that, fill the <code>maximum(int[] tab)</code> method, which parameter "
"is the array to explore."
msgstr ""
"Dans cet exercice, vous devez retrouver le maximum des valeurs stockées dans "
"un\n"
"tableau. Pour cela, remplissez le corps de la méthode <code>maximum(int[]\n"
"tab)</code>, dont le paramètre est le tableau à explorer."

#. type: Content of: <p>
#: src/lessons/welcome/array/MaxValue.html:7
msgid ""
"To compute this value, sweep over the whole parameter. For each value, if "
"it's bigger than the biggest value you saw so far, you must save this value "
"somewhere to remember it afterward. You thus need an extra variable, which "
"can be initialized to the value of the first array cell. Another possibility "
"is to initialize it to the smallest integer that Java knows about (which can "
"be retrieved through <code>Integer.MIN_VALUE</code>)."
msgstr ""
"Pour résoudre cet exercice, parcourez le tableau. Pour chaque case, si sa\n"
"valeur est plus grande que la plus grande des valeurs que vous avez "
"rencontré\n"
"jusque là, sauvegardez cette nouvelle championne pour retrouver sa valeur "
"plus\n"
"tard. Il vous faut donc une nouvelle variable; la valeur initiale de la\n"
"championne pourrait être la valeur rangée dans la première case. Une autre\n"
"possibilité est d'utiliser pour cela la plus petite valeur entière connue "
"de\n"
"Java (qui s'écrit <code>Integer.MIN_VALUE</code>)."

#. type: Content of: <h1>
#: src/lessons/welcome/array/OccurrenceOfValue.html:1
msgid "Occurrence of a value"
msgstr "Occurrences d'une valeur"

#. type: Content of: <p>
#: src/lessons/welcome/array/OccurrenceOfValue.html:3
msgid ""
"In this exercise, you must compute the amount of occurrences of a given "
"value in an array (that is, the amount of time that this value appears in "
"the array). For that, fill the <code>occurrences(int[] tab, int lookingFor)</"
"code> method, which returns the number of occurrence of <code>lookingFor</"
"code> in <code>tab</code>."
msgstr ""
"Dans cet exercice, il vous faut calculer le nombre d'occurrences d'une valeur\n"
"donnée, c'est à dire le nombre de fois que cette valeur apparaît dans le\n"
"tableau. Pour cela, remplissez le corps de la méthode <code>occurrences(int[]\n"
"tab, int lookingFor)</code>, qui retourne le nombre d'occurrences de\n"
"<code>lookingFor</code> dans <code>tab</code>."

#. type: Content of: <p>
#: src/lessons/welcome/array/OccurrenceOfValue.html:8
msgid ""
"To compute this value, simply sweep over the array counting for the amount "
"of cells containing the searched value. You thus need an extra variable for "
"that."
msgstr ""
"Pour calculer cette valeur, parcourez simplement le tableau en comptant le\n"
"nombre de cases contenant la valeur cherchée que vous rencontrez. Il vous faut\n"
"donc un paramètre supplémentaire pour cela."
110 changes: 109 additions & 1 deletion lib/l10n/jlm.pot
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2011-10-06 23:58+0300\n"
"POT-Creation-Date: 2011-10-07 00:42+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -7467,3 +7467,111 @@ msgstr ""
#: src/lessons/welcome/array/IndexOfValue.html:24
msgid "So, the last value of an array is given by <code>tab[tab.length - 1]</code>."
msgstr ""

#. type: Content of: <h1>
#: src/lessons/welcome/array/AverageValue.html:1
msgid "Average value"
msgstr ""

#. type: Content of: <p>
#: src/lessons/welcome/array/AverageValue.html:4
msgid ""
"The objective of this exercise is to compute the average value of the "
"integer values stored in an array."
msgstr ""

#. type: Content of: <p>
#: src/lessons/welcome/array/AverageValue.html:6
msgid ""
"You have to fill the body of the method <code>average(int[] tab)</code> "
"which takes as parameter the array of integers of which it computes and "
"returns the average value. Please note that the return type of the method "
"has type <code>int</code>."
msgstr ""

#. type: Content of: <p>
#: src/lessons/welcome/array/AverageValue.html:8
msgid ""
"To compute the average value of an integer, it is necessary to traverse the "
"whole array and to compute the sum of all its values (so you will need a "
"variable to store this temporary result), then you have to divide this sum "
"by the size of the array. In Java, you can get the size of an array "
"<code>myarray</code> by consulting its <code>length</code> attribute (in "
"other words, <code>myarray.length</code>)."
msgstr ""

#. type: Content of: <h1>
#: src/lessons/welcome/array/IndexOfMaxValue.html:1
msgid "Index of the maximum value"
msgstr ""

#. type: Content of: <p>
#: src/lessons/welcome/array/IndexOfMaxValue.html:3
msgid ""
"In this exercise, you must compute the indice of the tab cell containing the "
"biggest value."
msgstr ""

#. type: Content of: <p>
#: src/lessons/welcome/array/IndexOfMaxValue.html:5
msgid ""
"For that, fill the <code>indexOfMaximum(int[] tab)</code> method. Its "
"parameter is the array to explore. Should the array contain the searched "
"value several times, you should return the indice of the first occurrence."
msgstr ""

#. type: Content of: <p>
#: src/lessons/welcome/array/IndexOfMaxValue.html:9
msgid ""
"To solve this exercise, you should sweep over the whole array. For each "
"value, if it's bigger than the biggest value you saw so far, you must save "
"this new champion and its position. You will thus need 2 extra variables; "
"the initial value of the champion could be the value of the first cell."
msgstr ""

#. type: Content of: <h1>
#: src/lessons/welcome/array/MaxValue.html:1
msgid "Maximal value"
msgstr ""

#. type: Content of: <p>
#: src/lessons/welcome/array/MaxValue.html:3
msgid ""
"In this exercise, you must compute the maximal value contained in an array. "
"For that, fill the <code>maximum(int[] tab)</code> method, which parameter "
"is the array to explore."
msgstr ""

#. type: Content of: <p>
#: src/lessons/welcome/array/MaxValue.html:7
msgid ""
"To compute this value, sweep over the whole parameter. For each value, if "
"it's bigger than the biggest value you saw so far, you must save this value "
"somewhere to remember it afterward. You thus need an extra variable, which "
"can be initialized to the value of the first array cell. Another possibility "
"is to initialize it to the smallest integer that Java knows about (which can "
"be retrieved through <code>Integer.MIN_VALUE</code>)."
msgstr ""

#. type: Content of: <h1>
#: src/lessons/welcome/array/OccurrenceOfValue.html:1
msgid "Occurrence of a value"
msgstr ""

#. type: Content of: <p>
#: src/lessons/welcome/array/OccurrenceOfValue.html:3
msgid ""
"In this exercise, you must compute the amount of occurrences of a given "
"value in an array (that is, the amount of time that this value appears in "
"the array). For that, fill the <code>occurrences(int[] tab, int "
"lookingFor)</code> method, which returns the number of occurrence of "
"<code>lookingFor</code> in <code>tab</code>."
msgstr ""

#. type: Content of: <p>
#: src/lessons/welcome/array/OccurrenceOfValue.html:8
msgid ""
"To compute this value, simply sweep over the array counting for the amount "
"of cells containing the searched value. You thus need an extra variable for "
"that."
msgstr ""
4 changes: 4 additions & 0 deletions po4a.conf
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,7 @@
[type: html] src/lessons/bat/string1/StringYak.html $lang:src/lessons/bat/string1/StringYak.$lang.html

[type: html] src/lessons/welcome/array/IndexOfValue.html $lang:src/lessons/welcome/array/IndexOfValue.$lang.html
[type: html] src/lessons/welcome/array/AverageValue.html $lang:src/lessons/welcome/array/AverageValue.$lang.html
[type: html] src/lessons/welcome/array/IndexOfMaxValue.html $lang:src/lessons/welcome/array/IndexOfMaxValue.$lang.html
[type: html] src/lessons/welcome/array/MaxValue.html $lang:src/lessons/welcome/array/MaxValue.$lang.html
[type: html] src/lessons/welcome/array/OccurrenceOfValue.html $lang:src/lessons/welcome/array/OccurrenceOfValue.$lang.html
18 changes: 18 additions & 0 deletions src/lessons/welcome/array/AverageValue.fr.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<h1>Valeur moyenne</h1>


<p>L'objectif de cet exercice est de calculer la valeur moyenne d'un tableau de
valeur entière.</p>

<p>Vous devez donc remplir le corps de la méthode <code>average(int[]
tab)</code> qui prend en paramètre le tableau, et qui retourne en résultat
la valeur moyenne. Notez bien que le résultat de cette méthode est de type
<code>int</code></p>

<p>Pour calculer la valeur moyenne d'un tableau, il faut parcourir l'ensemble
des valeurs du tableau, en faire la somme (vous aurez donc besoin d'une
variable pour conserver le résultat intermédiaire), puis diviser cette somme
par le nombre de valeur contenu dans le tableau. On vous rappelle que vous
pouvez obtenir la taille d'un tableau <code>montableau</code> en consultant
la valeur de l'attribut <code>length</code> de ce tableau (autrement dit
<code>montableau.length</code>).</p>
8 changes: 0 additions & 8 deletions src/lessons/welcome/array/AverageValueOfArray.fr.html

This file was deleted.

19 changes: 19 additions & 0 deletions src/lessons/welcome/array/IndexOfMaxValue.fr.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<h1>Indice de la valeur maximale</h1>

<p>Dans cet exercice, vous devez calculer l'indice de la case contenant la plus
grande valeur du tableau.</p>

<p>Pour cela, remplissez la méthode <code>indexOfMaximum(int[] tab)</code> dont
le
paramètre est le tableau à explorer. Si jamais la plus grande des valeurs du
tableau est répétée plusieurs fois, votre méthode doit renvoyer la position
de
la première occurence.</p>

<p>Pour résoudre cet exercice, vous devez parcourir le tableau. Pour chaque
case,
si sa valeur est plus grande que la plus grande des valeurs que vous avez
rencontré jusque là, sauvegardez cette nouvelle championne et sa
position. Il
vous faut donc deux nouvelles variables; la valeur initiale de la championne
pourrait être la valeur rangée dans la première case.</p>
10 changes: 10 additions & 0 deletions src/lessons/welcome/array/IndexOfMaxValue.html
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
<h1>Index of the maximum value</h1>

<p>In this exercise, you must compute the indice of the tab cell containing the biggest value.</p>

<p>For that, fill the <code>indexOfMaximum(int[] tab)</code> method. Its parameter is the array to
explore. Should the array contain the searched value
several times, you should return the indice of the first occurrence.</p>

<p>To solve this exercise, you should sweep over the whole array. For each value, if it's bigger
than the biggest value you saw so far, you must save this new champion and its position.
You will thus need 2 extra variables; the initial value of the champion could be the value of the first cell.</p>
Loading

0 comments on commit ecc28db

Please sign in to comment.