Branch yann #6

Merged
YanNThO merged 47 commits from Branch_Yann into main 2021-02-01 18:36:46 +01:00
2 changed files with 35 additions and 30 deletions
Showing only changes of commit fb768899c4 - Show all commits

View file

@ -3,7 +3,7 @@
<option name="myName" value="Project Default" /> <option name="myName" value="Project Default" />
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true"> <inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<Languages> <Languages>
<language minSize="66" name="Java" /> <language minSize="371" name="Java" />
</Languages> </Languages>
</inspection_tool> </inspection_tool>
</profile> </profile>

View file

@ -7,6 +7,9 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
/**
* Classe permettant de renvoyer les statistiques
*/
public class Statistics { public class Statistics {
public DataBase maDB; public DataBase maDB;
public Connection conn; public Connection conn;
@ -53,11 +56,11 @@ public class Statistics {
} }
/** /**
* Methode affichant les numeros avec leur frequence d'apparition * Methode renvoyant les numeros avec leur frequence d'apparition
* @throws SQLException * @throws SQLException
*/ */
public void afficherChiffre1() throws SQLException { public int[][] numero1() throws SQLException {
System.out.println("debut afficherChiffre1"); System.out.println("debut numero1");
int k=0, numprec=0, l=0; int k=0, numprec=0, l=0;
ResultSet rs=null; ResultSet rs=null;
String sql; String sql;
@ -130,16 +133,17 @@ public class Statistics {
System.out.println(); System.out.println();
l=0; l=0;
} }
return (int)numId[0][0];
} }
/** /**
* Methode affichant les combinaisons a deux numeros en fonction du premier numero choisi * Methode renvoyant les combinaisons a deux numeros en fonction du premier numero choisi
* @param chiffre1 premiere combinaison * @param chiffre1 premiere combinaison
* @throws SQLException * @throws SQLException
*/ */
public void afficherCombinaisons2(int chiffre1) throws SQLException { public void combinaison2(int chiffre1) throws SQLException {
afficherChiffre1(); numero1();
System.out.println("debut afficherCombinaisons2"); System.out.println("debut combinaison2");
numSelect[1]=chiffre1; numSelect[1]=chiffre1;
int j=0, k=0, l=0, cpt=0; int j=0, k=0, l=0, cpt=0;
for(int i=1;i<50;i++) { for(int i=1;i<50;i++) {
@ -176,15 +180,15 @@ public class Statistics {
} }
/** /**
* Methode affichant les combinaisons a trois numeros en fonction des deux numeros choisi * Methode renvoyant les combinaisons a trois numeros en fonction des deux numeros choisi
* @param chiffre1 * @param chiffre1
* @param chiffre2 * @param chiffre2
* @throws SQLException * @throws SQLException
*/ */
public void afficherCombinaisons3(int chiffre1, int chiffre2) throws SQLException { public void combinaison3(int chiffre1, int chiffre2) throws SQLException {
afficherChiffre1(); numero1();
afficherCombinaisons2(chiffre1); combinaison2(chiffre1);
System.out.println("debut afficherCombinaisons3"); System.out.println("debut combinaison3");
numSelect[2]=chiffre2; numSelect[2]=chiffre2;
int j=0, k=0, m=0, cpt=0; int j=0, k=0, m=0, cpt=0;
for(int i=1;i<50;i++) { for(int i=1;i<50;i++) {
@ -221,10 +225,11 @@ public class Statistics {
} }
/** /**
* Methode renvoyant les numeros bonus avec leur frequence d'apparition
* @throws SQLException * @throws SQLException
*/ */
public void afficherBonus() throws SQLException { public void bonus() throws SQLException {
System.out.println("debut afficherBonus"); System.out.println("debut bonus");
int k=0, numprec=0, l=0; int k=0, numprec=0, l=0;
ResultSet rs=null; ResultSet rs=null;
String sql; String sql;
@ -290,14 +295,14 @@ public class Statistics {
} }
/** /**
* Methode affichant les numeros bonus avec leur frequence d'apparition * Methode renvoyant les numeros bonus en fonction des combinaisons à un numeros
* @param chiffre1 * @param chiffre1
* @throws SQLException * @throws SQLException
*/ */
public void afficherNumBonus(int chiffre1) throws SQLException { public void bonusCombi1(int chiffre1) throws SQLException {
afficherChiffre1(); numero1();
this.afficherBonus(); this.bonus();
System.out.println("debut afficherNumBonus"); System.out.println("debut bonus");
numSelect[1]=chiffre1; numSelect[1]=chiffre1;
int j=0, k=0, l=0, cpt=0; int j=0, k=0, l=0, cpt=0;
for(int i=1;i<11;i++) { for(int i=1;i<11;i++) {
@ -333,15 +338,15 @@ public class Statistics {
} }
/** /**
* Methode affichant les numeros bonus en fonction des combinaisons à deux numeros * Methode renvoyant les numeros bonus en fonction des combinaisons à deux numeros
* @param chiffre1 * @param chiffre1
* @param chiffre2 * @param chiffre2
* @throws SQLException * @throws SQLException
*/ */
public void afficherNumBonusCombi2(int chiffre1, int chiffre2) throws SQLException { public void bonusCombi2(int chiffre1, int chiffre2) throws SQLException {
afficherCombinaisons2(chiffre1); combinaison2(chiffre1);
afficherBonus(); bonus();
System.out.println("debut afficherNumBonusCombi2"); System.out.println("debut bonusCombi2");
numSelect[1]=chiffre1; numSelect[1]=chiffre1;
numSelect[2]=chiffre2; numSelect[2]=chiffre2;
int j=0, k=0, l=0, cpt=0; int j=0, k=0, l=0, cpt=0;
@ -378,16 +383,16 @@ public class Statistics {
} }
/** /**
* Methode affichant les numeros bonus en fonction des combinaisons à trois numeros * Methode renvoyant les numeros bonus en fonction des combinaisons à trois numeros
* @param chiffre1 * @param chiffre1
* @param chiffre2 * @param chiffre2
* @param chiffre3 * @param chiffre3
* @throws SQLException * @throws SQLException
*/ */
public void afficherNumBonusCombi3(int chiffre1, int chiffre2, int chiffre3) throws SQLException { public void bonusCombi3(int chiffre1, int chiffre2, int chiffre3) throws SQLException {
afficherCombinaisons3(chiffre1, chiffre2); combinaison3(chiffre1, chiffre2);
afficherBonus(); bonus();
System.out.println("debut afficherNumBonusCombi3"); System.out.println("debut bonusCombi3");
numSelect[1]=chiffre1; numSelect[1]=chiffre1;
numSelect[2]=chiffre2; numSelect[2]=chiffre2;
numSelect[3]=chiffre3; numSelect[3]=chiffre3;