MàJ par récupération sur Clé USB et dans /mnt/hd/Chargement du pc portable
This commit is contained in:
71
G5a/Exercices/1-Environnement.html
Normal file
71
G5a/Exercices/1-Environnement.html
Normal file
@ -0,0 +1,71 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>exosJava-syntaxe</title>
|
||||
<meta http-equiv="Content-Type"
|
||||
content="text/html; charset=windows-1252">
|
||||
<link rel="stylesheet" href="perso.css" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Premi<EFBFBD>re connexion<br>
|
||||
</h1>
|
||||
<span style="font-family: Arial;">
|
||||
<h2 style="font-family: Arial;">Les aides </h2>
|
||||
<p style="font-family: Arial;">1. Le cours sur l'extranet : "<a href="http://tetras.u-strasbg.fr">https://tetras.u-strasbg.fr</a>"
|
||||
Onglet : Pedagogie/LP/G5a</p>
|
||||
<p style="font-family: Arial;">2. Les sujets d'exercices, les corrig<69>s ,
|
||||
supports de cours en pdf et divers documents sur "<a href="http://pipit/~divoux/G5a">http://pipit/~divoux/G5a</a>" </p>
|
||||
<p style="font-family: Arial;">3 . La documentation java de Sun (doc de classes,
|
||||
tutoriaux,...) en anglais ! sur "java.sun.com" cf aussi sur l'extranet
|
||||
G5a : "Liens"</p>
|
||||
<p style="font-family: Arial;">4. Les <20>diteurs de code java : Notepad++, jEdit</p>
|
||||
<h2 style="font-family: Arial;">D<EFBFBD>but java</h2>
|
||||
<p style="font-family: Arial;">1. Sur votre r<>pertoire personnel (X:) creez un
|
||||
r<EFBFBD>pertoire "G5a" et un sous r<>pertoire "java"</p>
|
||||
<p style="font-family: Arial;">2. Recopiez le package "iutsud" (sur
|
||||
pipit) avec son r<>pertoire dans votre rep "java" </p>
|
||||
<p style="font-family: Arial;">3. Positionnez les variables d'environnement :
|
||||
PATH : doit acc<63>der aux ex<65>cutables "java" et "javac" dans
|
||||
C:/Program Files/java/jdk1.5.0 ; CLASSPATH indique le chemin des classes
|
||||
ex<EFBFBD>cutables (les .class) : il doit pointer sur votre r<>pertoire java (l<> o<>
|
||||
sont les .class), sur le r<>pertoire o<> vous avez plac<61> "iutsud" et
|
||||
sur le r<>pertoire courant</p>
|
||||
<p style="font-family: Arial;">4. V<>rifiez en tapant sous une fen<65>tre DOS
|
||||
"java -version" ---> version 1.5.0</p>
|
||||
<p style="font-family: Arial;">5. Recopiez chez vous (rep "java") les
|
||||
2 programmes "Puissance1" et "Puissance2" , compilez et
|
||||
ex<EFBFBD>cutez</p>
|
||||
<p style="font-family: Arial;">6. Cherchez sur la doc java de Sun ce que font
|
||||
les 2 instructions suivantes du pg "Puissance2"</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p style="font-family: Arial;">x=Integer.parseInt(ch1)</li>
|
||||
<li>
|
||||
<p style="font-family: Arial;">JOptionPane.showMessageDialog(null,"Resultat....</li>
|
||||
</ul>
|
||||
<p style="font-family: Arial;"> Comment changer le titre
|
||||
de la fen<65>tre de r<>sultat ? Comment changer son ic<69>ne ? remplacez le
|
||||
"!" par un ic<69>ne d'information "i" </p>
|
||||
<h2 style="font-family: Arial;">Mon premier programme Java : </h2>
|
||||
<h3 style="font-family: Arial;">Bonjour </h3>
|
||||
<p style="font-family: Arial;">1.
|
||||
Ecrire
|
||||
<EFBFBD> l'aide d'un <20>diteur de texte, un
|
||||
programme Java qui affiche <20> l'<27>cran
|
||||
"Bonjour
|
||||
!" ; le sauvegarder
|
||||
sous le nom : "Bonjour.java"</p>
|
||||
<p style="font-family: Arial;">2.
|
||||
Compiler avec la commande <code>javac
|
||||
Bonjour.java <big><span style="font-family: Arial;">(verifier le
|
||||
chemin
|
||||
d'acc<63>s <20> javac)</span></big>
|
||||
</code></p>
|
||||
<strong style="font-weight: normal;">3.</strong>
|
||||
<span style="font-family: Arial;">Ex<EFBFBD>cuter
|
||||
le programme avec la commande</span>
|
||||
<code>java Bonjour </code><code><big><span style="font-family: Arial;">(verifier
|
||||
le chemin
|
||||
d'acc<63>s <20> vos classes CLASSPATH)</span></big></code>
|
||||
</body>
|
||||
</html>
|
131
G5a/Exercices/2-exosSyntaxeJava.html
Normal file
131
G5a/Exercices/2-exosSyntaxeJava.html
Normal file
@ -0,0 +1,131 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>exosJava-syntaxe</title>
|
||||
<meta http-equiv="Content-Type"
|
||||
content="text/html; charset=windows-1252">
|
||||
<link rel="stylesheet" href="perso.css" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Exercices Syntaxe Java<br>
|
||||
</h1>
|
||||
<span style="font-family: Arial;">
|
||||
<h2 style="font-family: Arial;">Mes premiers programmes Java : </h2>
|
||||
<h3 style="font-family: Arial;">Bonjour </h3>
|
||||
<p style="font-family: Arial;">1.
|
||||
Ecrire
|
||||
<EFBFBD> l'aide d'un <20>diteur de texte, un
|
||||
programme Java qui affiche <20> l'<27>cran
|
||||
"Bonjour
|
||||
!" ; le sauvegarder
|
||||
sous le nom : "Bonjour.java"</p>
|
||||
<p style="font-family: Arial;">2.
|
||||
Compiler avec la commande <code>javac
|
||||
Bonjour.java <big><span style="font-family: Arial;">(verifier le
|
||||
chemin
|
||||
d'acc<63>s <20> javac)</span></big><br>
|
||||
</code></p>
|
||||
<strong style="font-weight: normal;">3.</strong>
|
||||
<span style="font-family: Arial;">Ex<EFBFBD>cuter
|
||||
le programme avec la commande</span>
|
||||
<code>java Bonjour </code><code><big><span style="font-family: Arial;">(verifier
|
||||
le chemin
|
||||
d'acc<63>s <20> vos classes CLASSPATH)</span></big></code>
|
||||
<h3 style="font-family: Arial;">Bonjour toi
|
||||
</h3>
|
||||
<strong></strong><span style="font-family: Arial;">Saisie de votre <span style="font-weight: bold;">pr<EFBFBD>nom </span>et
|
||||
de votre ann<6E>e de
|
||||
naissance puis affichage de la phrase : "Bonjour </span><span
|
||||
style="font-style: italic; font-family: Arial;">prenom,
|
||||
</span><span style="font-family: Arial;">vous
|
||||
avez xx ans"</span>
|
||||
<ul style="font-family: Arial;">
|
||||
<li><small> </small>1. En
|
||||
utilisant le
|
||||
package "iutsud" <code><span style="font-family: Arial;"><big>(verifier
|
||||
le chemin
|
||||
d'acc<63>s <20> ce package)</big></span></code> <br>
|
||||
</li>
|
||||
<li>2. En utilisant JOptionPane</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h3>Puissance
|
||||
</h3>
|
||||
R<EFBFBD><EFBFBD>crire le programme "<span style="font-weight: bold;">puissance</span>"
|
||||
avec un
|
||||
autre algorithme de calcul (attention :x puissance 0=1 et 0 puissance 0
|
||||
n'est pas d<>fini)<br>
|
||||
<h2 style="font-family: Arial;">Avec passage
|
||||
d'arguments
|
||||
</h2>
|
||||
<h3 style="font-family: Arial;"><br>
|
||||
InverseArgs
|
||||
</h3>
|
||||
<p style="font-family: Arial;">Ecrire un programme
|
||||
Java affichant la liste des arguments pass<73>s en
|
||||
param<EFBFBD>tre dans l'ordre inverse
|
||||
de celui donn<6E> par
|
||||
l'utilisateur. Affiche un message
|
||||
d'erreur si il n'y a pas d'arguments.</p>
|
||||
<ul style="font-family: Arial;">
|
||||
<p style="font-family: Arial;">
|
||||
<small>NB : args[i] donne le
|
||||
i<EFBFBD>me argument ; args.length donne le nombre d'arguments (la
|
||||
taille du tableau) ; les indices de tableau commencent <20> 0</small></p>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<pre>> java InverseArgs
|
||||
vous avez oubli<6C> les arguments...</pre>
|
||||
<pre>> java InverseArgs ! bien c'est Java
|
||||
Java c'est bien !</pre>
|
||||
</blockquote>
|
||||
<h3>Somme</h3>
|
||||
<p>Ecrire un programme Java effectuant
|
||||
la somme
|
||||
des entiers pass<73>s
|
||||
en arguments. Dans le
|
||||
cas o<> il n'y a pas d'argument, il affiche le message
|
||||
d'erreur : "vous avez oubli<6C> les arguments...". S'il n'y a
|
||||
qu'un seul argument, il affiche le message : "vous n'avez
|
||||
pass<EFBFBD> qu'un seul argument : X", avec X l'argument
|
||||
pass<EFBFBD>. Utilisez le "switch".<br>
|
||||
</p>
|
||||
<blockquote>
|
||||
<pre>> java SommeEntiers
|
||||
vous avez oubli<6C> les arguments...
|
||||
> java SommeEntiers 2
|
||||
vous n'avez pass<73> qu'un seul argument : 2
|
||||
> java SommeEntiers 1 9 3
|
||||
somme = 13
|
||||
</pre>
|
||||
</blockquote>
|
||||
<h3>Premier</h3>
|
||||
<p>Ecrire un programme Java qui lit un entier au clavier et qui d<>termine s'il
|
||||
s'agit ou non d'un nombre premier (sinon, afficher le premier multiple) ; saisir
|
||||
le chiffre 0 arr<72>te le programme.</span>
|
||||
</p>
|
||||
<blockquote>
|
||||
<pre><font face="Courier New">
|
||||
> java Premier
|
||||
Votre nombre :
|
||||
>19
|
||||
19 est premier
|
||||
Votre nombre :
|
||||
>21
|
||||
21 n'est pas premier, il est multiple de 3
|
||||
Votre nombre :
|
||||
>1
|
||||
1 n'est pas premier par d<>finition
|
||||
Votre nombre :
|
||||
>0
|
||||
>
|
||||
|
||||
|
||||
</pre>
|
||||
</blockquote>
|
||||
</font>
|
||||
</body>
|
||||
</html>
|
118
G5a/Exercices/3-exosClasses1.html
Normal file
118
G5a/Exercices/3-exosClasses1.html
Normal file
@ -0,0 +1,118 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
|
||||
<TITLE>exosJavaClasse 1</TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.2 (Win32)">
|
||||
<META NAME="CREATED" CONTENT="20070910;17190910">
|
||||
<META NAME="CHANGED" CONTENT="16010101;0">
|
||||
<STYLE TYPE="text/css">
|
||||
<!--
|
||||
@page { size: 21cm 29.7cm }
|
||||
H2.western { font-family: "Albany", sans-serif; font-size: 14pt; font-style: italic }
|
||||
H2.cjk { font-family: "HG Mincho Light J"; font-size: 14pt; font-style: italic }
|
||||
H2.ctl { font-family: "Arial Unicode MS"; font-size: 14pt; font-style: italic }
|
||||
-->
|
||||
</STYLE>
|
||||
</HEAD>
|
||||
<BODY LANG="fr-FR" DIR="LTR">
|
||||
<H1><FONT FACE="Arial">Exercices java : Classes et héritage</FONT></H1>
|
||||
<H2 CLASS="western"><FONT FACE="Arial">1. Adherent</FONT></H2>
|
||||
<UL>
|
||||
<P><FONT FACE="Arial"><B>1.1.</B> Traduire en java la classe
|
||||
"Adherent" vue en cours </FONT>
|
||||
</P>
|
||||
</UL>
|
||||
<P>
|
||||
<IMG SRC="DCA-Adherent.jpg" NAME="Image1" ALT="DCA-adherent" ALIGN=BOTTOM WIDTH=221 HEIGHT=235 BORDER=0>
|
||||
</P>
|
||||
<UL>
|
||||
<P><FONT FACE="Arial"><BR><B>1.2. </B>Creer le constructeur et un
|
||||
main qui utilise cette classe (création d'
|
||||
adherents , cotisation...,) ; ajouter une methode "etat()"
|
||||
qui renvoie "a jour" ou "pas a jour" et une
|
||||
methode toString()<BR><B>1.3. </B>Créer un package "PackAdh"
|
||||
; y placer la classe Adherent et une classe "Gerant"
|
||||
qui fait la saisie de 3 adherents et teste à chaque fois
|
||||
l'etat de ses adherents : (1, Dupont ,Paris 1980) ; (2, Meyer,
|
||||
Strasbourg, 1955) ; (3,Legwenn,Brest,1960) </FONT>
|
||||
</P>
|
||||
</UL>
|
||||
<UL>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><FONT FACE="Arial">Dupont
|
||||
verse 45 -> à jour</FONT></BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><FONT FACE="Arial">Meyer
|
||||
verse 30 -> non à jour </FONT>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE STYLE="margin-bottom: 0cm"><FONT FACE="Arial">Legwenn
|
||||
verse 40 -> non à jour </FONT>
|
||||
</BLOCKQUOTE>
|
||||
<LI><BLOCKQUOTE><FONT FACE="Arial">Meyer verse 15 <FONT FACE="Arial">->
|
||||
à jour</FONT> </FONT>
|
||||
</BLOCKQUOTE>
|
||||
</UL>
|
||||
<H2 CLASS="western"><FONT FACE="Arial">2. Personne/Femme </FONT>
|
||||
</H2>
|
||||
<UL>
|
||||
<P><STRONG><FONT FACE="Arial">2.1.</FONT></STRONG><FONT FACE="Arial">
|
||||
Créer une classe "Personne" avec nom et année
|
||||
de naissance ; ajouter le constructeur et une méthode
|
||||
toString qui affiche les 2 propriétés ; ajouter un
|
||||
main qui crée quelques personnes. </FONT>
|
||||
</P>
|
||||
<P><FONT FACE="Arial"><B>2.2.</B> Créer une classe "Femme"
|
||||
qui hérite de Personne et qui possède en plus un nom
|
||||
de jeune fille ; ajouter le constructeur et une méthode
|
||||
toString qui affiche les 3 propriétés. Modifiez le
|
||||
main pour avoir le résultat suivant : </FONT>
|
||||
</P>
|
||||
<BLOCKQUOTE><FONT FACE="Courier New">Dupont 1970 <BR>Dupont 1972 née
|
||||
Durand</FONT></BLOCKQUOTE>
|
||||
</UL>
|
||||
<H2 CLASS="western"><FONT FACE="Arial">3. Confitures </FONT>
|
||||
</H2>
|
||||
<UL>
|
||||
<P><STRONG><FONT FACE="Arial">3.1.</FONT></STRONG><FONT FACE="Arial">
|
||||
Créer avec un AGL (StarUML, argoUML...) une classe "Confiture" comme
|
||||
celle-ci :</FONT></P>
|
||||
</UL>
|
||||
<P ALIGN=CENTER STYLE="margin-bottom: 0cm"><IMG SRC="Confiture.jpg" NAME="Image2" ALT="confiture" ALIGN=BOTTOM WIDTH=252 HEIGHT=117 BORDER=0></P>
|
||||
<P ALIGN=LEFT>
|
||||
</P>
|
||||
<UL>
|
||||
<P><STRONG><FONT FACE="Arial">3.2.</FONT></STRONG><FONT FACE="Arial">
|
||||
Compléter et générer : </FONT>
|
||||
</P>
|
||||
<UL>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><FONT FACE="Arial">Créer
|
||||
des accesseurs publics (get et set) pour les attributs sauf pour
|
||||
"id" qui doit etre incrémenté
|
||||
automatiquement (get seulement) Saisir le code du constructeur
|
||||
(ajouter ce qu'il faut pour l'autoincrémentation) </FONT>
|
||||
</P>
|
||||
<LI><P STYLE="margin-bottom: 0cm"><FONT FACE="Arial">Générer
|
||||
le code du programme java correspondant. Ecrire une méthode
|
||||
</FONT><CODE><FONT FACE="Arial">main</FONT></CODE><FONT FACE="Arial">
|
||||
pour créer deux confitures et afficher l'id, le parfum et le
|
||||
nom du cuisinier. </FONT>
|
||||
</P>
|
||||
<LI><P><FONT FACE="Arial">Tester</FONT></P>
|
||||
</UL>
|
||||
</UL>
|
||||
<UL>
|
||||
<P><STRONG><FONT FACE="Arial">3.3.</FONT></STRONG><FONT FACE="Arial">
|
||||
Ajouter à la classe </FONT><CODE><FONT FACE="Arial">Confiture</FONT></CODE><FONT FACE="Arial">
|
||||
une méthode </FONT><CODE><FONT FACE="Arial">toString()</FONT></CODE><FONT FACE="Arial">
|
||||
qui renvoie une chaîne de caractères décrivant
|
||||
la confiture (id, parfum, cuisinier, année). </FONT>
|
||||
</P>
|
||||
<P><STRONG><FONT FACE="Arial">3.4.</FONT></STRONG><FONT FACE="Arial">
|
||||
Pour afficher la description des confitures, il est maintenant
|
||||
possible d'utiliser la méthode </FONT><CODE><FONT FACE="Arial">println()</FONT></CODE><FONT FACE="Arial">
|
||||
avec un argument de type </FONT><CODE><FONT FACE="Arial">Confiture</FONT></CODE><FONT FACE="Arial">.
|
||||
A tester dans la méthode </FONT><CODE><FONT FACE="Arial">main</FONT></CODE></P>
|
||||
</UL>
|
||||
<P STYLE="margin-left: 1.06cm"><BR><BR>
|
||||
</P>
|
||||
</BODY>
|
||||
</HTML>
|
214
G5a/Exercices/3.1-emp1.html
Normal file
214
G5a/Exercices/3.1-emp1.html
Normal file
@ -0,0 +1,214 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
|
||||
<TITLE>Feuille d’exercice N° 1 </TITLE>
|
||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.2 (Win32)">
|
||||
<META NAME="AUTHOR" CONTENT="Divoux P">
|
||||
<META NAME="CREATED" CONTENT="20050920;18230000">
|
||||
<META NAME="CHANGEDBY" CONTENT="pascal">
|
||||
<META NAME="CHANGED" CONTENT="20070913;12050000">
|
||||
<META NAME="CLASSIFICATION" CONTENT="modélisation objet">
|
||||
<META NAME="DESCRIPTION" CONTENT="Exercices sur le DCA avec héritage et sans relations">
|
||||
<STYLE TYPE="text/css">
|
||||
<!--
|
||||
@page { size: 21cm 29.7cm; margin-right: 1.75cm; margin-top: 0.75cm; margin-bottom: 1.04cm }
|
||||
P { margin-right: -0cm; margin-bottom: 0cm; border-top: 1px solid #000000; border-bottom: none; border-left: none; border-right: none; padding-top: 0.04cm; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; direction: ltr; color: #000000; text-align: justify; widows: 2; orphans: 2 }
|
||||
P.western { font-family: "Times New Roman", serif; font-size: 10pt; so-language: fr-FR }
|
||||
P.cjk { font-family: "Times New Roman", serif; font-size: 10pt }
|
||||
P.ctl { font-family: "Times New Roman", serif; font-size: 10pt }
|
||||
H1 { margin-top: 0cm; margin-bottom: 0cm; direction: ltr; color: #000000; text-align: justify; widows: 2; orphans: 2 }
|
||||
H1.western { font-family: "Times New Roman", serif; font-size: 14pt; so-language: fr-FR }
|
||||
H1.cjk { font-family: "Times New Roman", serif; font-size: 14pt }
|
||||
H1.ctl { font-family: "Times New Roman", serif; font-size: 10pt; font-weight: medium }
|
||||
-->
|
||||
</STYLE>
|
||||
</HEAD>
|
||||
<BODY LANG="fr-FR" TEXT="#000000" DIR="LTR">
|
||||
<DIV TYPE=HEADER>
|
||||
<P ALIGN=LEFT STYLE="margin-left: -0.5cm; margin-right: 0cm; margin-bottom: 0.9cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Helv, Arial, sans-serif"><FONT SIZE=2 STYLE="font-size: 9pt"><B>Formation
|
||||
UML P. Divoux</B></FONT></FONT></P>
|
||||
</DIV>
|
||||
<H1 CLASS="western" ALIGN=CENTER STYLE="background: #b2b2b2; border: 1px solid #000000; padding: 0.04cm">
|
||||
<FONT FACE="Comic Sans MS, cursive">Employé -Service</FONT></H1>
|
||||
<P CLASS="western" ALIGN=JUSTIFY STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<BR>
|
||||
</P>
|
||||
<H1 CLASS="western" STYLE="border-top: 1px solid #000000; border-bottom: none; border-left: none; border-right: none; padding-top: 0.04cm; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm">
|
||||
<FONT FACE="Comic Sans MS, cursive">Employé Version 1</FONT></H1>
|
||||
<P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<BR>
|
||||
</P>
|
||||
<P CLASS="western" ALIGN=JUSTIFY STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Dans une entreprise, un employé
|
||||
est identifié par son matricule (un nombre), on veut pouvoir
|
||||
afficher son nom, son adresse, son ancienneté, son service
|
||||
d’affectation (ex : "Comptabilité") et le
|
||||
montant de sa prime ; La prime d’un employé est calculée
|
||||
en multipliant le nombre d’années d’ancienneté
|
||||
par un coefficient identique pour tous les employés :
|
||||
"coeffPrime" (qui vaut actuellement 120) ; pour les
|
||||
commerciaux, cette prime est augmentée d'un intéressement
|
||||
proportionnel au chiffre d’affaire qu’ils ont réalisé
|
||||
(la valeur de "pourcentInteressement" est actuellement de
|
||||
15%).</FONT></P>
|
||||
<P STYLE="margin-right: 0cm; border: none; padding: 0cm"><FONT FACE="Arial, sans-serif">Représentez
|
||||
la structure de classes (DCA) et placez les attributs et les
|
||||
accesseurs nécessaires ainsi que les méthodes suivantes
|
||||
:</FONT></P>
|
||||
<P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<BR>
|
||||
</P>
|
||||
<UL>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">getAdresse() ; retourne l'adresse de
|
||||
l'employé concerné</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">getEmp(matricule) ; retourne
|
||||
l'employé dont le matricule est passé en paramètre</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">anciennete() ; retourne l'ancienneté
|
||||
de l'employé</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">getService() ; retourne le libellé
|
||||
du service de l'employé courant</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">changerService(nouveauService:String)
|
||||
; change le service de l'employé avec celui passé en
|
||||
paramètre </FONT>
|
||||
</P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">getPrimes(); calcule le montant de la
|
||||
prime (intéressement compris dans le cas des commerciaux)</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">getPlusAncien(); retourne l'employé
|
||||
qui a la plus grande ancienneté </FONT>
|
||||
</P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">getType() ; retourne le type
|
||||
d’employé : « simple employé »
|
||||
ou « commercial »</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">NouvelEmploye
|
||||
(nom,adresse,anneeEmbauche,service)</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">NouveauCommercial(nom,adresse,
|
||||
anneeEmbauche,service)</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Modifier le CA d’un commercial
|
||||
(nouvelle_valeur)</FONT></P>
|
||||
</UL>
|
||||
<P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">RQ : Le matricule est
|
||||
auto-incrémenté à chaque nouvel employé
|
||||
(il ne figure pas comme paramètre de
|
||||
« NouvelEmploye(n,a,ae,s) » il faut en tenir
|
||||
compte dans le modèle</FONT></P>
|
||||
<P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<BR>
|
||||
</P>
|
||||
<P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Pensez aux précisions suivantes
|
||||
: </FONT>
|
||||
</P>
|
||||
<P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<BR>
|
||||
</P>
|
||||
<UL>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Typez les attributs, les paramètres,
|
||||
les valeurs de retour des opérations </FONT>
|
||||
</P>
|
||||
</UL>
|
||||
<UL>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Préfixez correctement les
|
||||
attributs et méthodes selon leur nature : individuel,
|
||||
collectif ou commun </FONT>
|
||||
</P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Pensez aussi aux éléments
|
||||
abstraits (classes et méthodes)</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Documentez en quelques mots les
|
||||
classes, attributs et opérations dans l'onglet
|
||||
"Documentation" (voir l'exemple des méthodes
|
||||
ci-dessus)</FONT></P>
|
||||
</UL>
|
||||
<P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<BR>
|
||||
</P>
|
||||
<P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Vérifiez que les opérations
|
||||
suivantes sont réalisables : </FONT>
|
||||
</P>
|
||||
<P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<BR>
|
||||
</P>
|
||||
<UL>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Obtenir les caractéristiques
|
||||
(nom, adresse, service, ancienneté et, éventuellement,
|
||||
chiffre d’affaire) de l’employé de matricule X</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Obtenir le nom et la prime de
|
||||
l’employé le plus ancien</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Afficher la liste de tous les
|
||||
employés avec nom et service</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Lister les employés du service
|
||||
« Comptabilité » </FONT>
|
||||
</P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Lister tous les services avec leur
|
||||
nom et leur nombre d'employés</FONT></P>
|
||||
</UL>
|
||||
<P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<BR>
|
||||
</P>
|
||||
<P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Code Java </FONT>
|
||||
</P>
|
||||
<P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<BR>
|
||||
</P>
|
||||
<UL>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Saisissez le modèle avec un
|
||||
AGL</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Codez le corps des méthodes
|
||||
dans l’onglet approprié </FONT>
|
||||
</P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Ajoutez les constructeurs et une
|
||||
methode </FONT><FONT FACE="Courier New, monospace">toString() </FONT><FONT FACE="Arial, sans-serif">dans
|
||||
chaque classe qui affiche les informations essentielles : nom,
|
||||
ancienneté, prime …</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Paramétrez correctement les
|
||||
options de génération et de compilation</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Générez, complétez
|
||||
et compilez le code java </FONT>
|
||||
</P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Générez la javadoc</FONT></P>
|
||||
<LI><P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif">Testez en ajoutant une classe
|
||||
« Main » qui crée un petit jeu d’essai
|
||||
de 5 employés dont 2 commerciaux et qui liste les
|
||||
caractéristiques des 5 employés</FONT></P>
|
||||
</UL>
|
||||
<P ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm"><BR>
|
||||
</P>
|
||||
<P CLASS="western" ALIGN=LEFT STYLE="margin-right: 0cm; border: none; padding: 0cm">
|
||||
<FONT FACE="Arial, sans-serif"> </FONT></P>
|
||||
<DIV TYPE=FOOTER>
|
||||
<P ALIGN=LEFT STYLE="margin-right: 0cm; margin-top: 0.61cm; border: none; padding: 0cm">
|
||||
<SDFIELD TYPE=DOCINFO SUBTYPE=CHANGE FORMAT=DATE SDNUM="1036;1036;JJ/MM/AAAAAA HH:MM:SS AM/PM">13/09/200707 12:05:00 PM</SDFIELD> <SDFIELD TYPE=PAGE SUBTYPE=RANDOM FORMAT=PAGE>1</SDFIELD> emp1</P>
|
||||
</DIV>
|
||||
</BODY>
|
||||
</HTML>
|
BIN
G5a/Exercices/3.2western.pdf
Normal file
BIN
G5a/Exercices/3.2western.pdf
Normal file
Binary file not shown.
255
G5a/Exercices/4-exosClasses2.html
Normal file
255
G5a/Exercices/4-exosClasses2.html
Normal file
File diff suppressed because one or more lines are too long
195
G5a/Exercices/5.1-StringTableaux.html
Normal file
195
G5a/Exercices/5.1-StringTableaux.html
Normal file
@ -0,0 +1,195 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
||||
|
||||
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
|
||||
|
||||
<meta name="ProgId" content="FrontPage.Editor.Document">
|
||||
<title>Palindromes</title>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<span style="font-family: Arial;">
|
||||
<h1>Strings, tableaux et matrices</h1>
|
||||
|
||||
<h3><span style="font-weight: bold;">Palindromes</span></h3>
|
||||
|
||||
<span style="font-weight: bold;">1.
|
||||
</span>Ecrire un programme
|
||||
qui prend en argument un mot constitué
|
||||
uniquement de lettres minuscules ou majuscules (pas d'espace ni
|
||||
d'accent) et qui indique si le paramètre est un palindrome
|
||||
ou non.<br>
|
||||
|
||||
<code><br>
|
||||
|
||||
> Palindrome senones<br>
|
||||
|
||||
vrai<br>
|
||||
|
||||
> Palindrome
|
||||
Senones<br>
|
||||
|
||||
faux </code><br>
|
||||
|
||||
<br>
|
||||
|
||||
<span style="font-weight: bold;">2.</span> adapter
|
||||
ce programme pour le rendre insensible aux espaces et aux
|
||||
Majuscules<br>
|
||||
|
||||
<code><br>
|
||||
|
||||
> Palindrome Esope reste ici et
|
||||
se repose<br>
|
||||
|
||||
vrai</code><br>
|
||||
|
||||
<br>
|
||||
|
||||
<span style="font-weight: bold;">3.</span>
|
||||
adapter ce programme
|
||||
pour le rendre insensible aux
|
||||
lettres
|
||||
accentuées (créer une fonction qui remplace un
|
||||
caractère par sa version acceptable ê-->e )<br>
|
||||
|
||||
<code><br>
|
||||
|
||||
> Palindrome élu par
|
||||
cette crapule<br>
|
||||
|
||||
vrai<br>
|
||||
|
||||
</code>
|
||||
<h3><span style="font-weight: bold;">Produit de
|
||||
matrices</span></h3>
|
||||
|
||||
Ecrire un
|
||||
programme Java calculant la somme et le
|
||||
produit de deux matrices carrées de même taille.
|
||||
<pre>> java Matrices 3 1 2 3<br>Erreur de syntaxe !<br>java Matrices n A1...A(n*n) B1...B(n*n)<br>n : taille des matrices<br>A et B : les deux matrices<br>> java Matrices 3 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9<br>Matrice : A<br> 1 4 7<br> 2 5 8<br> 3 6 9<br>Matrice : B<br> 1 4 7<br> 2 5 8<br> 3 6 9<br>Matrice : Somme de A et B<br> 2 8 14<br> 4 10 16<br> 6 12 18<br>Matrice : Produit de A et B<br> 30 66 102<br> 36 81 126<br> 42 96 150</pre>
|
||||
|
||||
<p><span style="font-family: Arial;"></span><span style="font-family: Arial;"></span></p>
|
||||
|
||||
</span>
|
||||
<h3><span style="font-family: Arial;">
|
||||
</span></h3>
|
||||
<h3><span style="font-weight: bold;">Recherche
|
||||
dichotomique</span></h3>
|
||||
|
||||
|
||||
<span style="font-family: Arial;">
|
||||
<p><span style="font-family: Arial;"> </span>Ecrire
|
||||
un programme Java de
|
||||
recherche dichotomique d'un entier dans un tableau trié.</p>
|
||||
|
||||
</span><span style="font-family: Arial;">
|
||||
<blockquote>
|
||||
<pre>> java Dichotomique 23 1 3 7 9 12 23 44 53<br>l'entier 23 se trouve à l'indice 5 du tableau<br>> java Dichotomique 23 1 3 7 9 12 44 53<br>l'entier 23 ne se trouve pas dans le tableau<br><br><br></pre>
|
||||
|
||||
</blockquote>
|
||||
|
||||
<p><span style="font-family: Arial;">
|
||||
<h3><span style="font-weight: bold;">Conversion</span></h3>
|
||||
|
||||
</span><strong></strong>Ecrire un programme Java
|
||||
prenant en paramètre un entier et affichant sa valeur en
|
||||
binaire, on octale et en hexadécimale.</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>> java ConvertEntier 23<br>en binaire : 23 => 10111<br>en octale : 23 => 27<br>en hexadécimale : 23 => 17 <br></pre>
|
||||
|
||||
</blockquote>
|
||||
|
||||
<h3>Un triangle</h3>
|
||||
|
||||
<p><strong>1)</strong> Ecrire un programme qui
|
||||
affiche un triangle isocèle de base 2<var>n</var>-1
|
||||
et de hauteur <var>n</var>. L'entier <var>n</var>
|
||||
et le caractère utilisé pour tracer le triangle
|
||||
sont passés en argument sur la ligne de commande.</p>
|
||||
|
||||
<p><strong>2)</strong> Ajouter une option permettant
|
||||
d'indiquer la direction du triangle : -h = horizontale, -v = verticale.</p>
|
||||
|
||||
<p><strong>3)</strong> Si vous ne l'avez pas
|
||||
déjà fait, ajouter les
|
||||
lignes de commandes nécessaires afin de vérifier
|
||||
les arguments passés
|
||||
sur la ligne de commande : y-a-t-il 3 arguments ? Le premier est-il -h
|
||||
ou -v ? Le second représente-t-il un nombre ? Le
|
||||
troisième ne
|
||||
comporte-t-il qu'un seul caractère ?</p>
|
||||
|
||||
<p>En cas d'erreur, un message sera affiché
|
||||
et le programme terminera en renvoyant un code d'erreur.</p>
|
||||
|
||||
<h4>Exemple d'utilisation</h4>
|
||||
|
||||
<pre>> java Triangle -v 3 A<br>A<br>AA<br>AAA<br>AA<br>A<br>> java Triangle -h 4 $<br> $<br> $$$<br> $$$$$<br>$$$$$$$</pre>
|
||||
|
||||
<span style="font-family: Arial;">
|
||||
<h3><br>
|
||||
|
||||
<span style="font-weight: bold;"></span></h3>
|
||||
|
||||
<h3><br>
|
||||
|
||||
</h3>
|
||||
|
||||
<h3><span style="font-weight: bold;">Mots
|
||||
de 5 lettres </span>:</h3>
|
||||
|
||||
1. Faire un jeu qui permet
|
||||
de jouer aux "mots de 5 lettres" (ou mastermind des mots)<br>
|
||||
|
||||
<ul style="font-family: Arial;">
|
||||
|
||||
<ul>
|
||||
|
||||
<li>L'ordinateur tire au
|
||||
hasard un mot dans une liste de mots de 5 lettres (ex : PORTE)<br>
|
||||
|
||||
</li>
|
||||
|
||||
<li>Le joueur saisit un mot
|
||||
de 5 lettres (ex : RONDE)<br>
|
||||
|
||||
</li>
|
||||
|
||||
<li>L'ordinateur enregistre
|
||||
éventuellement dans sa liste propre ce nouveau mot de 5
|
||||
lettres et affiche au joueur le nombre de lettres correctes
|
||||
à la bonne place et de lettres correctes mal
|
||||
placées (ex : 2,1) <br>
|
||||
|
||||
</li>
|
||||
|
||||
<li>etc...</li>
|
||||
|
||||
<li>Le jeu se termine par la
|
||||
victoire de l'ordinateur si le joueur n'a pas trouvé au
|
||||
10ème coup</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>2. Faire en sorte que
|
||||
l'ordinateur puisse jouer aussi et "deviner" le mot choisi par le joueur<br>
|
||||
|
||||
<br>
|
||||
|
||||
</p>
|
||||
|
||||
</span>
|
||||
</span>
|
||||
</body>
|
||||
</html>
|
BIN
G5a/Exercices/5.2-robot-2.pdf
Normal file
BIN
G5a/Exercices/5.2-robot-2.pdf
Normal file
Binary file not shown.
BIN
G5a/Exercices/Confiture.jpg
Normal file
BIN
G5a/Exercices/Confiture.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.4 KiB |
BIN
G5a/Exercices/DCA-Adherent.jpg
Normal file
BIN
G5a/Exercices/DCA-Adherent.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
G5a/Exercices/PiecesComposites.pdf
Normal file
BIN
G5a/Exercices/PiecesComposites.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user