برامج

عاجل عاجل ( java ) أرجو المساعدة [الأرشيف] - برامج نت

المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : عاجل عاجل ( java ) أرجو المساعدة


zglool
03-19-2007, 05:18 PM
عندي مشكلة في حل هذا السؤال و بدنا نشوف مين هم عباقرة الجافا في هذا الموضوع على أن
يتم إرسال حل السؤال التالي :-

Write a library book class as follows:
A class to represent a book in a library, such that the following operations can be processed:
- Each book has a number which is serial for all books.
- Loan the book to someone which represented as integer number.
- Mark the book as being reserved.
- Cancel a reservation on a book.
- Ask if a book can be loaned. A book can only be loaned if it is not already on loan or is not reserved.
- Return the book.
- to_String that display book number, and who loans the book if book in loan, and display if the book is reserved or not.

أرجو المساعدة في هذا الموضوع و ياريت لو في نسخة إلكترونية ترسل على الإيميل
i1i1-0@hotmail.com

ولكم جزيل الشكر

zakimoulayabdellah
03-20-2007, 12:14 PM
ok friend
this exercice is home book
but i can help you
this is a half of solution
:smailes55: :smailes55: :smailes55: :smailes55:

public class Bib{
public Livre livre[] ;

Bib(){
livre = new Livre[];
}

public void preter(int i, String name){
for(int i = 0 ; i < livre.length ; i ++)
if (livre[i].name == name ) livre[i].valid = false ;

}


}




:smailes95: :smailes95: :smailes95: :smailes95: :smailes95: :smailes95: :smailes95:
public class Livre{
public int nb =0 ;
public String name ;
public boolean valid ;
Livre(){
nb ++
}
public String getName(){
return name ;
}
public String getNombre(){
return nb;
}
public void setName(String n){
this.name = n ;
}

public void setnb(int n ){
this.nb= n ;
}
public boolean getValid(){
return valid;
}
public void setValid(boolean va){
this.valid = va ;
}

}