Skip to content
Snippets Groups Projects
Commit b53e9076 authored by Malori Alvarez's avatar Malori Alvarez
Browse files

TP09-10

parent 54a899ab
No related branches found
No related tags found
No related merge requests found
File added
package tp9;
public class LogInManagement {
//attributs
public final static String LOGIN;
public final static String PWD;
//constructeur
//méthode
String getUserPwd(){
}
}
package tpQU3;
public class Person {
private String name;
private String forename;
public Person(String name, String forename){
this.name=name;
this.forename=forename;
}
public String getName(){
return name;
}
public String getForename(){
return forename;
}
public String toString(){
return forename+" "+name;
}
}
package tpQU3;
public class Student1 extends Person {
private static final int DEFAULT_DURATION_STUDENT1=20;
private boolean thirdTimeCredit;
public Student1(String name, String forename, boolean thirdTimeCredit){
super(name, forename);
this.thirdTimeCredit=thirdTimeCredit;
}
public Student1(String name, String forename){
this(name, forename, false);
}
public int getDefaultDuration(){
return DEFAULT_DURATION_STUDENT1;
}
public int getDuration(){
int time = DEFAULT_DURATION_STUDENT1;
if (thirdTimeCredit==true){
time = DEFAULT_DURATION_STUDENT1 *(1 +1/3);
}
return time;
}
public String toString(){
return super.toString()+" ("+getDuration()+")";
}
}
package tpQU3;
public class Student2 extends Student1 {
private static final int DEFAULT_DURATION_STUDENT2=30;
private boolean thirdTimeCredit;
public Student2(String name, String forename, boolean thirdTimeCredit){
super(name, forename);
this.thirdTimeCredit=thirdTimeCredit;
}
public Student2(String name, String forename){
this(name, forename, false);
}
public int getDefaultDuration(){
return DEFAULT_DURATION_STUDENT2;
}
public int getDuration(){
int time = DEFAULT_DURATION_STUDENT2;
if (thirdTimeCredit==true){
time = DEFAULT_DURATION_STUDENT2 *(1 +1/3);
}
return time;
}
public String toString(){
return super.toString()+" ("+getDuration()+")";
}
}
package tpQU3;
public class UseStudent {
public static void main(String[] args) {
}
}
package tp10;
public interface IPriority {
public int getPriority();
}
package tp10;
public interface IScheduler<T> {
public void addElement(T attribut);
public T highestPriority();
public boolean isEmpty();
public int size();
}
package tp10;
public class SchedulingQueue implements SchedulingQueue {
protected LinkedList<T> theQueue;
final int ID;
static int IDtemp;
public SchedulingQueue(LinkedList<T> Queue, int ID){
this.theQueue = new LinkedList<T>;
this.ID = IDtemp;
IDtemp++;
}
public int getID(){
return ID;
}
public String toString(){
// return "Queue"+ID+"->"+ ;
}
}
package tp10;
public class Task implements IPriority {
int priority;
String label;
public Task(String label, int priority){
this.label = label;
this.priority = priority;
}
//méthode
public int getPriority(){
return getPriority();
}
public String getLabel (){
return this.label;
}
public void setLabel(String label){
this.label = label;
}
public String toString(){
return getClass().getCanonicalName() + ":" + label+ "(" + priority + ")" ;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment