0% found this document useful (0 votes)
10 views1 page

Java Payable Interface and Invoice Class

Uploaded by

lucifergamlng2k1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

Java Payable Interface and Invoice Class

Uploaded by

lucifergamlng2k1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

interface Payable {

double getPayment();
}

class Invoice implements Payable {


String itemName;
int quantity;
double pricePerItem;

Invoice(String itemName, int quantity, double pricePerItem) {


[Link] = itemName;
[Link] = quantity;
[Link] = pricePerItem;
}

Invoice(String itemName, int quantity, double pricePerItem) {


[Link] = itemName;
[Link] = quantity;
[Link] = pricePerItem;
}

void display() {
[Link]("Invoice - Item: " + itemName + ", Quantity: " +
quantity + ", Price per Item: " + pricePerItem);
[Link]("Total Invoice Amount: Rs. " + getPayment());
}
}

class Staff implements Payable {


String name;
double salary;

Staff(String name, double salary) {


[Link] = name;
[Link] = salary;
}

You might also like