Académique Documents
Professionnel Documents
Culture Documents
ci-dessous :
int[][] }
Question 1
Compltez le constructeur ci-dessous en implmentant la fonction initialisation ()
/*constructeur public
*/
Sudoku(int n){
Question 2
Vous devez implmenter toutes les fonctions qui permettent de renvoyer ou de dfinir les attributs de la classe Sudoku. Ces fonctions commencent par les mots clefs get pour celles qui renvoient un attribut et set pour celles qui dfinissent un attribut.
You must implement all functions to return or set the attributes of the class Sudoku. These functions start with the keywords to get those referring to an attribute set and those that define an attribute.
public int getComplexite() { complter} public int[][] getGrille() { complter} public void setGrille(int i, int j, int unedonnee) { complter} public int getN () { complter} public void setN(int n) { complter } public int getPlacements() { complter } public void setPlacements(int lesplacements) { complter } public void setTableaufinal(int[][] tableaufinal) { complter} public void setGrille(int[][] grille) { complter} public int[][] getTableaufinal() { complter }
Question 3
crivez une fonction qui retourne un boolean et qui permet de vrifier si une grille est remplie ou non. Le nom qui sera donn cette fonction grilleremplie(). Vous devez galement soumettre lalgorithme de cette fonction. /* complter */grilleremplie() { complter}
Write a function that returns a boolean and can check if a grid is filled or not. The name to be given to this function grilleremplie (). You must also submit the algorithm of this function.
Question 4
crivez une fonction appele clonage qui permet de cloner un tableau dentiers deux dimensions. Cette fonction prend comme argument un tableau dentiers deux dimensions et retourne un autre tableau dentiers deux dimensions. Vous devez galement soumettre lalgorithme de cette fonction.
Write a function called cloning can clone an array of integers in two dimensions. This function takes as argument an array of integers and returns a two dimensional array of integers other two dimensions. You must also submit the algorithm of this function.
Question 5
crivez une fonction appele affichier qui prend comme paramtre un tableau deux dimensions et qui affiche tous ses lments. Vous devez galement soumettre lalgorithme de cette fonction.
Write a function called affichier which takes as a parameter a twodimensional array and displays it entirely. You must also submit the algorithm of this function
Question 6
Expliquez ce que fait cette fonction. Vous devez corriger toutes les erreurs
Question 7
Expliquez et donnez les algorithmes des trois fonctions suivantes
Fonction 1 :
public boolean chercherchiffrequadran(int chiffre, int[] tab){ boolean int int int int test=true; quadran, int[][]
//ATTENTION for(int
} }
return }
test;
Fonction 2 :
private boolean cherchequadran(int ligne, int colonne, chiffre) { int[] quadran=quadran(ligne,colonne); quadran, tab)){ int[][] tab, int
Fonction 3 :
private boolean cherchedg(int ligne, int colonne, int[][] boolean test=true; tab, int chiffre) {
for(int
return