Skip to content
Snippets Groups Projects
Commit 43f57d85 authored by EL MKOUDI Anass's avatar EL MKOUDI Anass
Browse files

premiere partie du tp2

parent ae32adf0
Branches SERRE_PRUNIER
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Forge</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
File added
File added
File added
package isima.com.forge;
public class DistanceException extends Exception {
public DistanceException(){
super();
}
}
package isima.com.forge;
public class Indemnite {
private double distance;
private double montant;
public Indemnite() {
montant=0;
distance=0;
}
public Indemnite(int distance) throws DistanceException{
if (distance<0) throw new DistanceException("distance invalide");
this.distance = distance;
montant=calculeIndemnite();
}
public double getDistance() {
return distance;
}
public void setDistance(double distance) {
this.distance = distance;
montant=calculeIndemnite();
}
public double getMontant() {
return montant;
}
public double calculeIndemnite(){
double total=0;
if(distance<10)total=total+distance*1.5;
else{
total=15;
if(distance<40 && distance>=10) total+=(distance-10)*0.4;
else {
total+=30*0.4;
if(distance<60 && distance>=40) total+=(distance-40)*0.55;
else {
total+=0.55*20;
total+=(((int)(distance-60)/20))*6.81;
}
}
}
return total;
}
public static void main(String[] args) {
Indemnite x=new Indemnite();
System.out.println(x.distance+"==>"+x.montant);
x.setDistance(-20);
System.out.println(x.distance+"==>"+x.montant);
x.setDistance(15.5);
System.out.println(x.distance+"==>"+x.montant);
x.setDistance(59);
System.out.println(x.distance+"==>"+x.montant);
x.setDistance(60);
System.out.println(x.distance+"==>"+x.montant);
x.setDistance(68);
System.out.println(x.distance+"==>"+x.montant);
}
}
package isima.com.forge;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class IndemniteTest {
@Before
public void setUp() throws Exception {
}
@Test
public void test() {
fail("Not yet implemented");
}
@Test
public void testCalculeIndemnite() {
assertEquals(new Long(4),
op.calculer(new Long(1), new Long(3)));
}
}
......@@ -475,7 +475,28 @@ $ git log --all --graph --decorate --oneline
##### 3. Merge
0. Merge depuis head
0. switcher sur une nouvelle branche `mybranch-3.1`
$ git branch Bouhanni-3.1
0. ajout un nouveau fichier nommé easy_merge avec la date et l'heure actuelle `*`
touch easy_merge $date>easy_merge
$ git commit -m "Q3.2"
[Bouhanni ae32adf] Q3.2
Committer: EL MKOUDI Anass <anelmkoudi@rcisima.isima.fr>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:
git config --global --edit
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
2 files changed, 55 insertions(+)
create mode 100644 easy_merge
0. merger la branche `mybranch-4.1` sur `mybranch`
0. Afficher le status
0. Pourquoi n'y a t'il aucune modification en cours ? `*`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment