controle 2
This commit is contained in:
BIN
DEV2.1/CM2/Prototype.class
Normal file
BIN
DEV2.1/CM2/Prototype.class
Normal file
Binary file not shown.
49
DEV2.1/CM2/Prototype.java
Normal file
49
DEV2.1/CM2/Prototype.java
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
//Patrick Felix-Vimalaratnam
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
|
||||||
|
public class Prototype{
|
||||||
|
public static void main(String[] args) {
|
||||||
|
if (args.length == 0) {
|
||||||
|
System.err.println("Manque le nom du fichier");
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
String nom = new String();
|
||||||
|
for (int i=0; i<args.length; i++){
|
||||||
|
nom=nom+args[i];
|
||||||
|
}
|
||||||
|
File f = new File(nom);
|
||||||
|
try{
|
||||||
|
f.createNewFile();
|
||||||
|
try{
|
||||||
|
FileOutputStream ecrit = new FileOutputStream(f);
|
||||||
|
String chaine = new String();
|
||||||
|
String ouvrant =new String();
|
||||||
|
String fermant =new String();
|
||||||
|
String espace =new String();
|
||||||
|
chaine = "public class";
|
||||||
|
ouvrant = "{";
|
||||||
|
fermant = "}";
|
||||||
|
espace = " ";
|
||||||
|
ecrit.write(chaine.getBytes());
|
||||||
|
ecrit.write(espace.getBytes());
|
||||||
|
ecrit.write(nom.getBytes());
|
||||||
|
ecrit.write(espace.getBytes());
|
||||||
|
ecrit.write(ouvrant.getBytes());
|
||||||
|
ecrit.write(espace.getBytes());
|
||||||
|
ecrit.write(fermant.getBytes());
|
||||||
|
try{
|
||||||
|
ecrit.close();
|
||||||
|
}catch(IOException e){
|
||||||
|
System.err.println("Erreur fermeture");
|
||||||
|
}
|
||||||
|
}catch(IOException e){
|
||||||
|
System.err.println("Erreur ecriture");
|
||||||
|
}
|
||||||
|
}catch(IOException e){
|
||||||
|
System.err.println("Erreur d'ouverture");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
4845
DEV2.1/CM2/Prudence.mdj
Normal file
4845
DEV2.1/CM2/Prudence.mdj
Normal file
File diff suppressed because it is too large
Load Diff
4196
DEV2.1/CM2/Puzzle.mdj
Normal file
4196
DEV2.1/CM2/Puzzle.mdj
Normal file
File diff suppressed because it is too large
Load Diff
5711
DEV2.1/CM2/processus.mdj
Normal file
5711
DEV2.1/CM2/processus.mdj
Normal file
File diff suppressed because it is too large
Load Diff
42
DEV2.1/Diagramme_Sequence/Prtotype.java
Normal file
42
DEV2.1/Diagramme_Sequence/Prtotype.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
//Patrick Felix-Vimalaratnam
|
||||||
|
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
public class Prototype{
|
||||||
|
public static void main(String[] args) {
|
||||||
|
if (args.length == 0) {
|
||||||
|
System.err.println("Manque le nom du fichier");
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
String nom = new String();
|
||||||
|
for (int i=0; i<args.length; i++){
|
||||||
|
nom=nom+args[i];
|
||||||
|
File f = new File(nom);
|
||||||
|
f.createNewFile();
|
||||||
|
try{
|
||||||
|
FileOutputStream ecrit = new FileOutputStream(f);
|
||||||
|
String chaine = new String();
|
||||||
|
String ouvrant =new String();
|
||||||
|
String fermant =new String();
|
||||||
|
String fermant =new String();
|
||||||
|
chaine = "public class";
|
||||||
|
ouvrant = "{";
|
||||||
|
fermant = "}";
|
||||||
|
espace = " ";
|
||||||
|
ecrit.write(chaine.getBytes());
|
||||||
|
ecrit.write(espace.getBytes());
|
||||||
|
ecrit.write(nom.getBytes());
|
||||||
|
ecrit.write(espace.getBytes());
|
||||||
|
ecrit.write(ouvrant.getBytes());
|
||||||
|
ecrit.write(espace.getBytes());
|
||||||
|
ecrit.write(fermant.getBytes());
|
||||||
|
try{
|
||||||
|
ecrit.close();
|
||||||
|
}catch(IOException e){
|
||||||
|
System.err.println("Erreur fermeture");
|
||||||
|
}
|
||||||
|
}catch(IOException e){
|
||||||
|
System.err.println("Erreur ecriture");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
DEV2.1/felix-vi_CM2.tar.gz
Normal file
BIN
DEV2.1/felix-vi_CM2.tar.gz
Normal file
Binary file not shown.
Reference in New Issue
Block a user