SlideShare una empresa de Scribd logo
1 de 7
Descargar para leer sin conexión
•   public class Point {
•   private int abs,ord;
•   public int getAbs() {
•   return abs;
•   }
•   public void setAbs(int a) {
•   abs = a;
•   }
•   public int getOrd() {
•   return ord;
•   }
•   public void setOrd(int o) {
•   ord = o;
•   }
•   Point(int a,int b)
•   {abs=a;
•   ord=b;}
•   public String toString() {
•   return " [abs=" + abs + ", ord=" + ord + "]";
•   }
•   }
•   public class Courbe {
•   private int nbrPoint , nbrMaxPoint;
•   private Point tab[];

•    //les getteurs et les setteurs
•   public int getNbrPoint() {
•   return nbrPoint;
•   }
•   public void setNbrPoint(int n1) {
•   nbrPoint = n1;
•   }
•   public int getNbrMaxPoint() {
•   return nbrMaxPoint;
•   }
•   public void setNbrMaxPoint(int n2) {
•   nbrMaxPoint = n2;
•   }
•   public Point[] getTab() {
•   return tab;
•   }
•   public void setTab(Point[] t) {
•   tab = t;}
•   //le constructeur
•   public Courbe(int n ){
•   nbrPoint=0;
•   nbrMaxPoint=n;
•      tab=new Point [n];}
•   //methodes possibles

• public Point minCourbe (){
• int j=0;
• int minOrd=tab[0].getOrd();
•   for (int i=1;i<nbrPoint;i++)
•   { if (tab[i].getOrd() < minOrd) j=i;}
•        return tab[j];
•                  }

• public void affiche () {
• System.out.print("voici la courbe");
• for (int i=0;i<nbrPoint;i++)System.out.print(tab[i]+" ");}
•   public int chercher (Point p){
•   int j=-1;
•   for (int i=0;i<nbrPoint;i++)
•   {if( (tab[i].getOrd()==p.getOrd()) &&(tab[i].getAbs()==p.getAbs()))
•     j=i;}
•         return j; }

•   public void ajouter (Point p){
•   if ( (nbrMaxPoint>nbrPoint) && (chercher(p)==-1) )
•   { tab[nbrPoint]=p;nbrPoint ++;}
•   else System.out.println("tableau plein");}

• public void supprimer (Point p) {
• int j = chercher(p);
• if(j==-1) System.out.println("le point"+p+" n'existe meme pas dans cette
  courbe !");
•   else {
• for (int i=j;i<nbrPoint;i++) {
• tab[i]=tab[i+1];}
• nbrPoint--;}}
• }
• public class TestCourbe {

•   public static void main(String[] args) {
•   Courbe c1 = new Courbe(100);
•   Point p1=new Point(5,6);
•   Point p2=new Point(6,7);
•   Point p3=new Point(11,55);
•   Point p4=new Point(17,41);
•   c1.ajouter(p1);
•   c1.ajouter(p2);
•   c1.ajouter(p3);
•   c1.affiche();
•   Point minimum= c1.minCourbe();
•   System.out.println(minimum);
•   c1.supprimer(p2);
•   c1.supprimer(p4);
•   }

• }

Más contenido relacionado

Destacado

Web vn
Web vnWeb vn
Web vnAnam
 
Agile Automation is not this Deepak P
Agile Automation is not this Deepak PAgile Automation is not this Deepak P
Agile Automation is not this Deepak PvodQA
 
Evaluation – question 3
Evaluation – question 3Evaluation – question 3
Evaluation – question 3JakeHafer
 
Spotkanie z ambasadorem
Spotkanie z ambasadoremSpotkanie z ambasadorem
Spotkanie z ambasadoremsknsz
 
Pr1 ri
Pr1 riPr1 ri
Pr1 riAnam
 
Llista provisional d'inscrits vn'12
Llista provisional d'inscrits vn'12Llista provisional d'inscrits vn'12
Llista provisional d'inscrits vn'12Anam
 
How to Have a Winning Team
How to Have a Winning TeamHow to Have a Winning Team
How to Have a Winning TeamJa-Nae Duane
 
Patterns & Anti Patterns of Stand up
Patterns & Anti Patterns of Stand upPatterns & Anti Patterns of Stand up
Patterns & Anti Patterns of Stand upvodQA
 
Narko
NarkoNarko
Narkosknsz
 
Understanding the federalism matrix
Understanding the federalism matrixUnderstanding the federalism matrix
Understanding the federalism matrixJim Huneycutt
 
Presentatie Verkoop nieuwe stijl bij Automotions Groep
Presentatie Verkoop nieuwe stijl bij Automotions GroepPresentatie Verkoop nieuwe stijl bij Automotions Groep
Presentatie Verkoop nieuwe stijl bij Automotions GroepPaul de Vries
 
Retrospective
RetrospectiveRetrospective
RetrospectivevodQA
 
Vysali - QC based framework
Vysali - QC based frameworkVysali - QC based framework
Vysali - QC based frameworkvodQA
 
Shortkeynote at the CoCreation und Collaboration Workshop
Shortkeynote at the CoCreation und Collaboration WorkshopShortkeynote at the CoCreation und Collaboration Workshop
Shortkeynote at the CoCreation und Collaboration Workshopjovoto GmbH
 
Gatling & LoadUI : Open Source Performance Testing Tools
Gatling & LoadUI : Open Source Performance Testing ToolsGatling & LoadUI : Open Source Performance Testing Tools
Gatling & LoadUI : Open Source Performance Testing ToolsvodQA
 

Destacado (20)

Web vn
Web vnWeb vn
Web vn
 
Poster inascl 2012
Poster inascl 2012Poster inascl 2012
Poster inascl 2012
 
Agile Automation is not this Deepak P
Agile Automation is not this Deepak PAgile Automation is not this Deepak P
Agile Automation is not this Deepak P
 
Barnes &noble
Barnes &nobleBarnes &noble
Barnes &noble
 
Evaluation – question 3
Evaluation – question 3Evaluation – question 3
Evaluation – question 3
 
Spotkanie z ambasadorem
Spotkanie z ambasadoremSpotkanie z ambasadorem
Spotkanie z ambasadorem
 
Utla.
Utla.Utla.
Utla.
 
Pr1 ri
Pr1 riPr1 ri
Pr1 ri
 
Llista provisional d'inscrits vn'12
Llista provisional d'inscrits vn'12Llista provisional d'inscrits vn'12
Llista provisional d'inscrits vn'12
 
How to Have a Winning Team
How to Have a Winning TeamHow to Have a Winning Team
How to Have a Winning Team
 
Patterns & Anti Patterns of Stand up
Patterns & Anti Patterns of Stand upPatterns & Anti Patterns of Stand up
Patterns & Anti Patterns of Stand up
 
Narko
NarkoNarko
Narko
 
Understanding the federalism matrix
Understanding the federalism matrixUnderstanding the federalism matrix
Understanding the federalism matrix
 
Credit score
Credit scoreCredit score
Credit score
 
Presentatie Verkoop nieuwe stijl bij Automotions Groep
Presentatie Verkoop nieuwe stijl bij Automotions GroepPresentatie Verkoop nieuwe stijl bij Automotions Groep
Presentatie Verkoop nieuwe stijl bij Automotions Groep
 
Retrospective
RetrospectiveRetrospective
Retrospective
 
Vysali - QC based framework
Vysali - QC based frameworkVysali - QC based framework
Vysali - QC based framework
 
Shortkeynote at the CoCreation und Collaboration Workshop
Shortkeynote at the CoCreation und Collaboration WorkshopShortkeynote at the CoCreation und Collaboration Workshop
Shortkeynote at the CoCreation und Collaboration Workshop
 
Intern powerpoint[1]
Intern powerpoint[1]Intern powerpoint[1]
Intern powerpoint[1]
 
Gatling & LoadUI : Open Source Performance Testing Tools
Gatling & LoadUI : Open Source Performance Testing ToolsGatling & LoadUI : Open Source Performance Testing Tools
Gatling & LoadUI : Open Source Performance Testing Tools
 

Más de Amel Morchdi

Cours réseaux informatiques ia2
Cours réseaux informatiques  ia2Cours réseaux informatiques  ia2
Cours réseaux informatiques ia2Amel Morchdi
 
Cours r _seaux__chapitre_5
Cours r _seaux__chapitre_5Cours r _seaux__chapitre_5
Cours r _seaux__chapitre_5Amel Morchdi
 
Cours réseaux chap3et4
Cours réseaux chap3et4Cours réseaux chap3et4
Cours réseaux chap3et4Amel Morchdi
 
Chapitre 2 poo classe objet c++
Chapitre 2 poo classe objet c++Chapitre 2 poo classe objet c++
Chapitre 2 poo classe objet c++Amel Morchdi
 
Chapitre 2 poo classe objet c++
Chapitre 2 poo classe objet c++Chapitre 2 poo classe objet c++
Chapitre 2 poo classe objet c++Amel Morchdi
 
Jeux d instruction du 6809
Jeux d instruction du 6809Jeux d instruction du 6809
Jeux d instruction du 6809Amel Morchdi
 
Cours r _seaux_chap1et2
Cours r _seaux_chap1et2Cours r _seaux_chap1et2
Cours r _seaux_chap1et2Amel Morchdi
 
Cours réseaux informatiques iia2
Cours réseaux informatiques  iia2Cours réseaux informatiques  iia2
Cours réseaux informatiques iia2Amel Morchdi
 
Exam seiia2gl20111
Exam seiia2gl20111Exam seiia2gl20111
Exam seiia2gl20111Amel Morchdi
 
Attachments 2011 12_19
Attachments 2011 12_19Attachments 2011 12_19
Attachments 2011 12_19Amel Morchdi
 
Java uik-chap4-poo3
Java uik-chap4-poo3Java uik-chap4-poo3
Java uik-chap4-poo3Amel Morchdi
 
Java uik-chap3-bases java
Java uik-chap3-bases javaJava uik-chap3-bases java
Java uik-chap3-bases javaAmel Morchdi
 
Java uik-chap2-dev java
Java uik-chap2-dev javaJava uik-chap2-dev java
Java uik-chap2-dev javaAmel Morchdi
 
Java uik-chap1-intro java
Java uik-chap1-intro javaJava uik-chap1-intro java
Java uik-chap1-intro javaAmel Morchdi
 
Td serie a-abstract-cast-heritage
Td serie a-abstract-cast-heritageTd serie a-abstract-cast-heritage
Td serie a-abstract-cast-heritageAmel Morchdi
 
Seria 3 iia2 2011_2012
Seria 3 iia2 2011_2012Seria 3 iia2 2011_2012
Seria 3 iia2 2011_2012Amel Morchdi
 
Attachments 2011 12_19
Attachments 2011 12_19Attachments 2011 12_19
Attachments 2011 12_19Amel Morchdi
 

Más de Amel Morchdi (20)

Cours réseaux informatiques ia2
Cours réseaux informatiques  ia2Cours réseaux informatiques  ia2
Cours réseaux informatiques ia2
 
Cours r _seaux__chapitre_5
Cours r _seaux__chapitre_5Cours r _seaux__chapitre_5
Cours r _seaux__chapitre_5
 
Cours réseaux chap3et4
Cours réseaux chap3et4Cours réseaux chap3et4
Cours réseaux chap3et4
 
Chapitre 2 poo classe objet c++
Chapitre 2 poo classe objet c++Chapitre 2 poo classe objet c++
Chapitre 2 poo classe objet c++
 
Chapitre 2 poo classe objet c++
Chapitre 2 poo classe objet c++Chapitre 2 poo classe objet c++
Chapitre 2 poo classe objet c++
 
Jeux d instruction du 6809
Jeux d instruction du 6809Jeux d instruction du 6809
Jeux d instruction du 6809
 
Cours r _seaux_chap1et2
Cours r _seaux_chap1et2Cours r _seaux_chap1et2
Cours r _seaux_chap1et2
 
Cours réseaux informatiques iia2
Cours réseaux informatiques  iia2Cours réseaux informatiques  iia2
Cours réseaux informatiques iia2
 
Corrections td4
Corrections td4Corrections td4
Corrections td4
 
Cours s epart2
Cours s epart2Cours s epart2
Cours s epart2
 
Exam seiia2gl20111
Exam seiia2gl20111Exam seiia2gl20111
Exam seiia2gl20111
 
Attachments 2011 12_19
Attachments 2011 12_19Attachments 2011 12_19
Attachments 2011 12_19
 
Java uik-chap4-poo3
Java uik-chap4-poo3Java uik-chap4-poo3
Java uik-chap4-poo3
 
Java uik-chap3-bases java
Java uik-chap3-bases javaJava uik-chap3-bases java
Java uik-chap3-bases java
 
Java uik-chap2-dev java
Java uik-chap2-dev javaJava uik-chap2-dev java
Java uik-chap2-dev java
 
Java uik-chap1-intro java
Java uik-chap1-intro javaJava uik-chap1-intro java
Java uik-chap1-intro java
 
Td serie a-abstract-cast-heritage
Td serie a-abstract-cast-heritageTd serie a-abstract-cast-heritage
Td serie a-abstract-cast-heritage
 
Seria 3 iia2 2011_2012
Seria 3 iia2 2011_2012Seria 3 iia2 2011_2012
Seria 3 iia2 2011_2012
 
Attachments 2011 12_19
Attachments 2011 12_19Attachments 2011 12_19
Attachments 2011 12_19
 
Cours s epartie2
Cours s epartie2Cours s epartie2
Cours s epartie2
 

Último

Résultats de la seconde vague du baromètre de la santé connectée 2024
Résultats de la seconde vague du baromètre de la santé connectée 2024Résultats de la seconde vague du baromètre de la santé connectée 2024
Résultats de la seconde vague du baromètre de la santé connectée 2024benj_2
 
Émile Nelligan - poète québécois, pris entre deux solitudes : la poèsie et la...
Émile Nelligan - poète québécois, pris entre deux solitudes : la poèsie et la...Émile Nelligan - poète québécois, pris entre deux solitudes : la poèsie et la...
Émile Nelligan - poète québécois, pris entre deux solitudes : la poèsie et la...Université de Montréal
 
《购买维多利亚大学学历本科学位证书》
《购买维多利亚大学学历本科学位证书》《购买维多利亚大学学历本科学位证书》
《购买维多利亚大学学历本科学位证书》rnrncn29
 
Planification familiale en situations de crise et post-crise - AZ.ppt
Planification familiale en situations de crise et post-crise - AZ.pptPlanification familiale en situations de crise et post-crise - AZ.ppt
Planification familiale en situations de crise et post-crise - AZ.pptOuedraogoSoumaila3
 
Le rôle central de la médecine interne dans l’évolution des systèmes de santé...
Le rôle central de la médecine interne dans l’évolution des systèmes de santé...Le rôle central de la médecine interne dans l’évolution des systèmes de santé...
Le rôle central de la médecine interne dans l’évolution des systèmes de santé...Khadija Moussayer
 
Biologie moléculaire_S6_ première partie .pptx
Biologie moléculaire_S6_ première partie .pptxBiologie moléculaire_S6_ première partie .pptx
Biologie moléculaire_S6_ première partie .pptxrababouerdighi
 
LA POLYARTHRITE RHUMATOIDE, UNE AMELIORATION DE LA PRISE EN CHARGE AVEC NOTAM...
LA POLYARTHRITE RHUMATOIDE, UNE AMELIORATION DE LA PRISE EN CHARGE AVEC NOTAM...LA POLYARTHRITE RHUMATOIDE, UNE AMELIORATION DE LA PRISE EN CHARGE AVEC NOTAM...
LA POLYARTHRITE RHUMATOIDE, UNE AMELIORATION DE LA PRISE EN CHARGE AVEC NOTAM...Khadija Moussayer
 
Dr MEHRI TURKI IMEN - Traitement du double menton : Une nouvelle technique tu...
Dr MEHRI TURKI IMEN - Traitement du double menton : Une nouvelle technique tu...Dr MEHRI TURKI IMEN - Traitement du double menton : Une nouvelle technique tu...
Dr MEHRI TURKI IMEN - Traitement du double menton : Une nouvelle technique tu...Aymen Masri
 

Último (8)

Résultats de la seconde vague du baromètre de la santé connectée 2024
Résultats de la seconde vague du baromètre de la santé connectée 2024Résultats de la seconde vague du baromètre de la santé connectée 2024
Résultats de la seconde vague du baromètre de la santé connectée 2024
 
Émile Nelligan - poète québécois, pris entre deux solitudes : la poèsie et la...
Émile Nelligan - poète québécois, pris entre deux solitudes : la poèsie et la...Émile Nelligan - poète québécois, pris entre deux solitudes : la poèsie et la...
Émile Nelligan - poète québécois, pris entre deux solitudes : la poèsie et la...
 
《购买维多利亚大学学历本科学位证书》
《购买维多利亚大学学历本科学位证书》《购买维多利亚大学学历本科学位证书》
《购买维多利亚大学学历本科学位证书》
 
Planification familiale en situations de crise et post-crise - AZ.ppt
Planification familiale en situations de crise et post-crise - AZ.pptPlanification familiale en situations de crise et post-crise - AZ.ppt
Planification familiale en situations de crise et post-crise - AZ.ppt
 
Le rôle central de la médecine interne dans l’évolution des systèmes de santé...
Le rôle central de la médecine interne dans l’évolution des systèmes de santé...Le rôle central de la médecine interne dans l’évolution des systèmes de santé...
Le rôle central de la médecine interne dans l’évolution des systèmes de santé...
 
Biologie moléculaire_S6_ première partie .pptx
Biologie moléculaire_S6_ première partie .pptxBiologie moléculaire_S6_ première partie .pptx
Biologie moléculaire_S6_ première partie .pptx
 
LA POLYARTHRITE RHUMATOIDE, UNE AMELIORATION DE LA PRISE EN CHARGE AVEC NOTAM...
LA POLYARTHRITE RHUMATOIDE, UNE AMELIORATION DE LA PRISE EN CHARGE AVEC NOTAM...LA POLYARTHRITE RHUMATOIDE, UNE AMELIORATION DE LA PRISE EN CHARGE AVEC NOTAM...
LA POLYARTHRITE RHUMATOIDE, UNE AMELIORATION DE LA PRISE EN CHARGE AVEC NOTAM...
 
Dr MEHRI TURKI IMEN - Traitement du double menton : Une nouvelle technique tu...
Dr MEHRI TURKI IMEN - Traitement du double menton : Une nouvelle technique tu...Dr MEHRI TURKI IMEN - Traitement du double menton : Une nouvelle technique tu...
Dr MEHRI TURKI IMEN - Traitement du double menton : Une nouvelle technique tu...
 

Pooderniercours

  • 1. public class Point { • private int abs,ord; • public int getAbs() { • return abs; • } • public void setAbs(int a) { • abs = a; • } • public int getOrd() { • return ord; • }
  • 2. public void setOrd(int o) { • ord = o; • } • Point(int a,int b) • {abs=a; • ord=b;} • public String toString() { • return " [abs=" + abs + ", ord=" + ord + "]"; • } • }
  • 3. public class Courbe { • private int nbrPoint , nbrMaxPoint; • private Point tab[]; • //les getteurs et les setteurs • public int getNbrPoint() { • return nbrPoint; • } • public void setNbrPoint(int n1) { • nbrPoint = n1; • } • public int getNbrMaxPoint() { • return nbrMaxPoint; • } • public void setNbrMaxPoint(int n2) { • nbrMaxPoint = n2; • } • public Point[] getTab() { • return tab; • } • public void setTab(Point[] t) { • tab = t;}
  • 4. //le constructeur • public Courbe(int n ){ • nbrPoint=0; • nbrMaxPoint=n; • tab=new Point [n];} • //methodes possibles • public Point minCourbe (){ • int j=0; • int minOrd=tab[0].getOrd(); • for (int i=1;i<nbrPoint;i++) • { if (tab[i].getOrd() < minOrd) j=i;} • return tab[j]; • } • public void affiche () { • System.out.print("voici la courbe"); • for (int i=0;i<nbrPoint;i++)System.out.print(tab[i]+" ");}
  • 5. public int chercher (Point p){ • int j=-1; • for (int i=0;i<nbrPoint;i++) • {if( (tab[i].getOrd()==p.getOrd()) &&(tab[i].getAbs()==p.getAbs())) • j=i;} • return j; } • public void ajouter (Point p){ • if ( (nbrMaxPoint>nbrPoint) && (chercher(p)==-1) ) • { tab[nbrPoint]=p;nbrPoint ++;} • else System.out.println("tableau plein");} • public void supprimer (Point p) { • int j = chercher(p); • if(j==-1) System.out.println("le point"+p+" n'existe meme pas dans cette courbe !"); • else { • for (int i=j;i<nbrPoint;i++) { • tab[i]=tab[i+1];} • nbrPoint--;}} • }
  • 6. • public class TestCourbe { • public static void main(String[] args) { • Courbe c1 = new Courbe(100); • Point p1=new Point(5,6); • Point p2=new Point(6,7); • Point p3=new Point(11,55); • Point p4=new Point(17,41); • c1.ajouter(p1); • c1.ajouter(p2); • c1.ajouter(p3); • c1.affiche();
  • 7. Point minimum= c1.minCourbe(); • System.out.println(minimum); • c1.supprimer(p2); • c1.supprimer(p4); • } • }