Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Prix {
- private static double total = 8, extraFromage = 1.50, extraViande = 2, qteLegume = 0, prixLegume = 0.50, extraSauce = 1.50;
- private final double base = 8;
- public Prix(){
- total = base;
- }
- public static double getTotal(){;
- return total;
- }
- public static void addExtraSauce(){
- total += extraSauce;
- }
- public static void removeExtraSauce(){
- total -= extraSauce;
- }
- public static void addExtraLegume(){
- total += (qteLegume * prixLegume);
- }
- public static void removeExtraLegume(){
- total -= (qteLegume * prixLegume);
- }
- public static void addExtraViande(){
- total += extraViande;
- }
- public static void removeExtraViande(){
- total -= extraViande;
- }
- public static void addExtraFromage(){
- total += extraFromage;
- }
- public static void removeExtraFromage(){
- total -= extraFromage;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement