interfaces help 11-25-2013, 11:51 PM
#1
this is a part of en exercice i got for uni
interfaces
Salable per kilogram: the interface for selling items per kilogram
methods:
Sale: This method receives the quantity sold of the item and change the stock
Salable piece: the interface for items that sell by pieces
methods:
Sale: This method receives the number of pieces sold of the item and change the stock
Likely to be sold in balance
methods:
start balance: This method lowers the price of the item by the given percentage
complete the balance: This method increases the price of the item by the given percentage
sry if there's any errors here this is translated from french to english using google translate blame google if theres anything wrong![Smile Smile](https://sinister.ly/images/smilies/set/smile.png)
ok so i need to do those interfaces i did the following but since its the first time i work with interface i wanted to check if my work is good b4 moving to next part of the exercice !!
interfaces
Salable per kilogram: the interface for selling items per kilogram
methods:
Sale: This method receives the quantity sold of the item and change the stock
Salable piece: the interface for items that sell by pieces
methods:
Sale: This method receives the number of pieces sold of the item and change the stock
Likely to be sold in balance
methods:
start balance: This method lowers the price of the item by the given percentage
complete the balance: This method increases the price of the item by the given percentage
sry if there's any errors here this is translated from french to english using google translate blame google if theres anything wrong
![Smile Smile](https://sinister.ly/images/smilies/set/smile.png)
ok so i need to do those interfaces i did the following but since its the first time i work with interface i wanted to check if my work is good b4 moving to next part of the exercice !!
Code:
public interface SalablePerKilogram {
public void sale(double quantitySold);
}
public interface SalablePiece {
public void vendre(double nbrOfPiecesSolde);
}
public interface SoldeInBalance {
public void startBalance(double pourcentage);
public void completeBalance(double pourcentage);
}
![[Image: blackeagle_zps6ad86521.gif]](http://i1363.photobucket.com/albums/r719/AmazeGotStyle/blackeagle_zps6ad86521.gif)