اذهب إلى المحتوى
  • 0

الميثود جافا

RAA

السؤال

كيف ممكن اعملهم

1-ميثود في كلاس الفاتورة لانشاء الطلب تستقبل المنتجات المختارة من الميثود Select الموجودة في كلاس المنتجات

2-ميثود في كلاس الفاتورة تستقبل الطلب + تستقبل معللومات العميل من كلاس العميل + المجموع الكلي للطلب

 

public class Invoices {
    
    public double total;
    private Customer customer;
    private Product product;
    
    public Invoices (double total0,Product products0,Customer customer0){
    this.total=total0;
    this.product = new Product(products0);
    this.customer= new Customer(customer0);
    }
    public Invoices(){
        this.total=0;
        this.product=null;
        this.customer=null;
    }

    public double getTotal() {
        return total;
    }

    public void setTotal(double total) {
        this.total = total;
    }

    public Product getProduct() {
        return new Product (product);
    }

    public void setProduct(Product products) {
        this.product = new Product (products);
    }

    public Customer getCustomer() {
        return new Customer (customer);
    }

   public class Invoices {
    
    public double total;
    private Customer customer;
    private Product product;
    
    public Invoices (double total0,Product products0,Customer customer0){
    this.total=total0;
    this.product = new Product(products0);
    this.customer= new Customer(customer0);
    }
    public Invoices(){
        this.total=0;
        this.product=null;
        this.customer=null;
    }

    public double getTotal() {
        return total;
    }

    public void setTotal(double total) {
        this.total = total;
    }

    public Product getProduct() {
        return new Product (product);
    }

    public void setProduct(Product products) {
        this.product = new Product (products);
    }

    public Customer getCustomer() {
        return new Customer (customer);
    }

    public void setCustomer(Customer customer) {
        this.customer = new Customer (customer);
    }
    public String toString(){
        String text="""
                    Invoices information :
                    Customer information :
                    """+this.customer+
                "\nThe products :\n"+this.product+"\nThe total price :" +this.total;
Return text;
        return null;
    }

   
}

 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

Recommended Posts

لا توجد أي إجابات على هذا السؤال بعد

انضم إلى النقاش

يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.

زائر
أجب على هذا السؤال...

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   جرى استعادة المحتوى السابق..   امسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

  • إعلانات

  • تابعنا على



×
×
  • أضف...