Skip to content
Snippets Groups Projects
Commit b73ff1a4 authored by Mail Ladjali's avatar Mail Ladjali
Browse files

Commit de base pour la suite du dev-oo

parent 77ac20ed
No related branches found
No related tags found
No related merge requests found
Showing
with 135 additions and 0 deletions
.DS_Store 0 → 100644
File added
File added
File added
class Conditions{
public static void main (String[] args){
int argent = 5500;
if(argent >= 5000){
System.out.println("Test");
}else {
System.out.println("Non");
}
}
}
\ No newline at end of file
File added
class Variables{
public static void main(String[] args){
int age = 65;
String pseudo = "Test";
System.out.println(age + ":" + pseudo);
age= age + 1;
System.out.println(age + ":" + pseudo);
}
}
\ No newline at end of file
File added
File added
class Book {
int year;
String title;
String author;
Book(String a,String b,int c){
this.author=a;
this.title=b;
this.year=c;
}
public String toString(){
return this.author + ":" + this.title + ":" + this.year;
}
}
\ No newline at end of file
File added
class HighScore{
Score[] top;
HighScore(){
this.top=new Score[100];
}
HighScore(int taillejeu){
int taille=100;
this.top=new Score[taille];
}
int getNbfreeSlot(){
}
}
\ No newline at end of file
File added
class Score{
int score;
String name;
String timestamp;
Score(String a,int b, String c){
this.timestamp=a;
this.name=c;
this.score=b;
}
public String toString(){
return this.timestamp + ":" + this.name + "=" + this.score;
}
}
\ No newline at end of file
File added
class UseBook {
public static void main(String[] args){
System.out.println();
}
}
\ No newline at end of file
File added
class UseBook2{
public static void main(String[] args){
Book[] livre= new Book[]{
new Book("Auteur1", "Titre1", 1789),
new Book("Auteur2", "Titre2", 1815),
new Book("Auteur3", "Titre3", 1914),
new Book("Auteur4", "Titre4", 1918),
new Book("Auteur5", "Titre5", 2015),
};
Book min=livre[0];
for(int i=0;i<livre.length;i++){
System.out.println(livre[i]);
}
for(int j=0;j>livre.length;j++){
System.out.println(min[j]);
}
}
}
\ No newline at end of file
File added
class Competitor{
private int score;
private int time;
private String numberSign;
public Competitor(int numberSign, int score, int min, int sec){
if(!verifierdossard(numberSign, score, min, sec)){
this.numberSign="invalide";
}
else{this.numberSign ="No"+ numberSign;
}
this.score = score;
this.time = 60*min + sec;
}
public String toString(){
return "(" + this.numberSign + ", " + this.score + " points, " + this.time + "s)";
}
public static boolean verifierdossard(int numberSign, int score, int min, int sec){
if(numberSign <1 || numberSign >100){
return false;
} else if(score <0 || score >50){
return false;
} else if (min <0 || min >59){
return false;
} else if (sec <0 || sec >59){
return false;
}return true;
}
public boolean equals(Competitor other){
if(this==other){
return true;
}else if(other==null){
return false;
}else if(this.numberSign.equals (other.numberSign) && this.score==other.score){
return true;
} return false;
}
public boolean isFaster(Competitor other){
if(this.time > other.time){
return false;
} return true;
}
}
\ No newline at end of file
class Dice{
private int numberSides;
private Random rand;
private int value;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment