add java's tp

master
antoine.perederii 2 years ago
parent 8057e7570b
commit 54b7ccef3f

@ -1011,7 +1011,7 @@
"top": 423,
"width": 164.41064453125,
"height": 13,
"text": "+toString()",
"text": "+toString(p: Patient)",
"horizontalAlignment": 0
}
],
@ -1369,7 +1369,7 @@
"font": "Arial;13;0",
"left": 503,
"top": 240,
"width": 12.65087890625,
"width": 13.83154296875,
"height": 13,
"alpha": 0.12306859015170946,
"distance": 88.61715409558128,
@ -2331,7 +2331,20 @@
"_parent": {
"$ref": "AAAAAAGLW6+k0yIUSUI="
},
"name": "toString"
"name": "toString",
"parameters": [
{
"_type": "UMLParameter",
"_id": "AAAAAAGLW8r4g0Atc1M=",
"_parent": {
"$ref": "AAAAAAGLW7PN2SzOuyo="
},
"name": "p",
"type": {
"$ref": "AAAAAAGLW588ex/TTbE="
}
}
]
}
]
},

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/2_tp.iml" filepath="$PROJECT_DIR$/.idea/2_tp.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../../.." vcs="Git" />
</component>
</project>

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="874c0d48-f96f-40eb-b022-998628881ab4" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/../1_tp/TP1/src/models/Patient.java" beforeDir="false" afterPath="$PROJECT_DIR$/../1_tp/TP1/src/models/Patient.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../../../.." />
</component>
<component name="ProjectId" id="2XL3rDbv1BMV4MSSpYdVpcHwdgG" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true"
}
}]]></component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="874c0d48-f96f-40eb-b022-998628881ab4" name="Changes" comment="" />
<created>1698394730221</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1698394730221</updated>
</task>
<servers />
</component>
</project>

@ -0,0 +1,2 @@
developper une app permettant a un gestionnaire de zoo de gerer les entrées sorties d'animaux dans son zoo. Il pourra a tout moment afficher l'etat (les infos) des animaux. En hiver, les animaux hiverne.
les oiseaux (cigogne, peroquet, ...) migrent du nord au sud du zoo. Les animaux à fourrure (ours, loups, ...) augmentent la densité de leur pelage.

@ -0,0 +1,26 @@
{
"_type": "Project",
"_id": "AAAAAAFF+h6SjaM2Hec=",
"name": "Untitled",
"ownedElements": [
{
"_type": "UMLModel",
"_id": "AAAAAAFF+qBWK6M3Z8Y=",
"_parent": {
"$ref": "AAAAAAFF+h6SjaM2Hec="
},
"name": "Model",
"ownedElements": [
{
"_type": "UMLClassDiagram",
"_id": "AAAAAAFF+qBtyKM79qY=",
"_parent": {
"$ref": "AAAAAAFF+qBWK6M3Z8Y="
},
"name": "Main",
"defaultDiagram": true
}
]
}
]
}

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="18" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/TP2.iml" filepath="$PROJECT_DIR$/TP2.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../../../.." vcs="Git" />
</component>
</project>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,26 @@
package main;
import models.Animal;
import models.AnimalFourrure;
import models.AnimalTheque;
import models.Oiseau;
import utilitaires.Afficheur;
public class Main {
public static void testOiseau(){
Animal oiseau = new Oiseau("sozio", 1);
System.out.println(oiseau.getNom());
System.out.println(oiseau.getZone());
System.out.println(oiseau.getClass());
}
public static void testAnimalFourrure(){
Animal af = new AnimalFourrure("ours", 1, 0);
System.out.println(af.getNom());
System.out.println(af.getZone());
System.out.println(af.getClass());
}
public static void main(String[] args){
testAnimalFourrure();
}
}

@ -0,0 +1,26 @@
package models;
import com.sun.management.UnixOperatingSystemMXBean;
public abstract class Animal {
protected String nom;
protected int zone;
protected Animal(String nomAnimal, int zoneAnimal){
this.nom = nomAnimal;
this.zone = zoneAnimal;
}
public int getZone() {
return zone;
}
public String getNom() {
return nom;
}
protected void setZone(int zone) {
this.zone = zone;
}
protected abstract void hiverner();
}

@ -0,0 +1,23 @@
package models;
public class AnimalFourrure extends Animal {
private int densiteFourrure;
public AnimalFourrure(String nomAnimal, int zoneAnimal, int densite) {
super(nomAnimal, zoneAnimal);
this.densiteFourrure = densite;
}
public void setFourrure(int densite){
this.densiteFourrure = densite;
}
public void hiverner() {
if(this.densiteFourrure == 1){
setFourrure(0);
}
else {
setFourrure(1);
}
}
}

@ -0,0 +1,9 @@
package models;
import java.util.ArrayList;
import java.util.List;
public class AnimalTheque {
public List<Animal> lesAnimaux = new ArrayList<>();
}

@ -0,0 +1,17 @@
package models;
public class Oiseau extends Animal{
public Oiseau(String nomAnimal, int zoneAnimal){
super(nomAnimal, zoneAnimal);
}
public void hiverner() {
if(this.zone == 0) {
super.setZone(1);
}
else {
super.setZone(0);
}
}
}

@ -0,0 +1,4 @@
package utilitaires;
public class Afficheur {
}

@ -0,0 +1,4 @@
package utilitaires;
public class Menu {
}

@ -0,0 +1,4 @@
package utilitaires;
public class Saisisseur {
}

@ -0,0 +1,4 @@
package utilitaires;
public class Suppresseur {
}
Loading…
Cancel
Save