Hamburger.java
public void calculatePriceAndShowAdditionals(boolean lettuce, boolean tomato, boolean carrot, boolean onion, boolean cheese, boolean nachos, boolean paprika) {
        this.itemNumber = 0; // itemNumber must be reset to 0 at the beginning. (in case of multiple calling of the function)
        this.price = 0; // price must be reset to 0 at the beginning.(in case of multiple calling of the function)

        this.lettuce = lettuce;
        this.tomato = tomato;
        this.carrot = carrot;
        this.onion = onion;
        this.cheese = cheese;
        this.nachos = nachos;
        this.paprika = paprika;

         System.out.println("");
         if (this.lettuce) {
            itemNumber++;
         }
         if (this.tomato) {
             itemNumber++;
         }
         if (this.carrot) {
             itemNumber++;
         }
         if (this.onion) {
             itemNumber++;
         }
         if (this.cheese) {
             itemNumber++;
         }
         if (this.nachos) {
             itemNumber++;
         }
         if (this.paprika) {
             itemNumber++;
         }

         // test for maximum number of allowed items
         System.out.println("");
         System.out.println(this.name + " burger -> this.maxAllowedItems: " + this.maxAllowedItems);
         System.out.println(this.name + " burger -> maxAllowedItems: " + maxAllowedItems);
         System.out.println("");
         // end of test

         System.out.println("Number of additionals after counting: " + itemNumber);
         if ((this.itemNumber>=0) && (this.itemNumber<=this.maxAllowedItems)) {
             if (name.equals("base")) {
                 System.out.println("The following type of burger was selected: " + this.name);
                 price += this.getBasePrice();
                 System.out.println("Base price is: " +this.getBasePrice());
             }
             System.out.println("Price of " + this.name + " hamburger without additional cost: " + basePrice);
             price += basePrice;
             if (lettuce) {
                 price += this.getLettucePrice();
                 System.out.println("Lettuce: " + this.lettucePrice +" $");
//                 System.out.println("Actual price is " + price +" $"); // test
             }
             if (tomato) {
                 price += this.getTomatoPrice();
                 System.out.println("Tomato: "  + this.tomatoPrice +" $");
//                 System.out.println("Actual price is " + price +" $"); // test
             }
             if (carrot) {
                 price += this.getCarrotPrice();
                 System.out.println("Carrot: "  + this.carrotPrice +" $");
//                 System.out.println("Actual price is " + price +" $"); // test
             }
             if (onion) {
                 price += this.getOnionPrice();
                 System.out.println("Onion:"  + this.onionPrice +" $");
//                 System.out.println("Actual price is " + price +" $"); // test
             }
             if (cheese) {
                 price += this.getCheesePrice();
                 System.out.println("Cheese: "  + this.cheesePrice +" $");
//                 System.out.println("Actual price is " + price +" $"); // test
             }
             if (nachos) {
                 price += this.getNachosPrice();
                 System.out.println("Nachos: "  + this.nachosPrice +" $");
//                 System.out.println("Actual price is " + price +" $"); // test
             }
             if (paprika) {
                 price += this.getPaprikaPrice();
                 System.out.println("Chips:"   + this.paprikaPrice +" $");
//                 System.out.println("Actual price is " + price +" $"); // test
             }
             System.out.println("Total price of " + this.name + ": " + price +" $");
         }
         else if(this.itemNumber < 0) {
             System.out.println("The number of additionals is negative: " +this.itemNumber );
         }
         else {
             System.out.println("The number of additionals " +this.itemNumber + " exeeds maximum: " + this.maxAllowedItems  );
             System.out.println("The price will not be calculated. Please reduce the number of selected additionals to " + this.maxAllowedItems +" !");
         }
     }
// "Maybe a new method should be created as input generator(type of hamburgers, extras, etc)" Description by Tim Buchalka

"Maybe a new method should be created as input generator(type of hamburgers, extras, etc)" Description by Tim Buchalka
" Maybe a new method should be created as input generator ( type of hamburgers extras etc ) " Description by Tim Buchalka
public void calculatePriceAndShowAdditionals(boolean lettuce, boolean tomato, boolean carrot, boolean onion, boolean cheese, boolean nachos, boolean paprika) {
        this.itemNumber = 0; 
        this.price = 0; 
        this.lettuce = lettuce;
        this.tomato = tomato;
        this.carrot = carrot;
        this.onion = onion;
        this.cheese = cheese;
        this.nachos = nachos;
        this.paprika = paprika;
         System.out.println("");
         if (this.lettuce) {
            itemNumber++;
         }
         if (this.tomato) {
             itemNumber++;
         }
         if (this.carrot) {
             itemNumber++;
         }
         if (this.onion) {
             itemNumber++;
         }
         if (this.cheese) {
             itemNumber++;
         }
         if (this.nachos) {
             itemNumber++;
         }
         if (this.paprika) {
             itemNumber++;
         }
         System.out.println("");
         System.out.println(this.name + " burger -> this.maxAllowedItems: " + this.maxAllowedItems);
         System.out.println(this.name + " burger -> maxAllowedItems: " + maxAllowedItems);
         System.out.println("");
         System.out.println("Number of additionals after counting: " + itemNumber);
         if ((this.itemNumber>=0) && (this.itemNumber<=this.maxAllowedItems)) {
             if (name.equals("base")) {
                 System.out.println("The following type of burger was selected: " + this.name);
                 price += this.getBasePrice();
                 System.out.println("Base price is: " +this.getBasePrice());
             }
             System.out.println("Price of " + this.name + " hamburger without additional cost: " + basePrice);
             price += basePrice;
             if (lettuce) {
                 price += this.getLettucePrice();
                 System.out.println("Lettuce: " + this.lettucePrice +" $");
             }
             if (tomato) {
                 price += this.getTomatoPrice();
                 System.out.println("Tomato: "  + this.tomatoPrice +" $");
             }
             if (carrot) {
                 price += this.getCarrotPrice();
                 System.out.println("Carrot: "  + this.carrotPrice +" $");
             }
             if (onion) {
                 price += this.getOnionPrice();
                 System.out.println("Onion:"  + this.onionPrice +" $");
             }
             if (cheese) {
                 price += this.getCheesePrice();
                 System.out.println("Cheese: "  + this.cheesePrice +" $");
             }
             if (nachos) {
                 price += this.getNachosPrice();
                 System.out.println("Nachos: "  + this.nachosPrice +" $");
             }
             if (paprika) {
                 price += this.getPaprikaPrice();
                 System.out.println("Chips:"   + this.paprikaPrice +" $");
             }
             System.out.println("Total price of " + this.name + ": " + price +" $");
         }
         else if(this.itemNumber < 0) {
             System.out.println("The number of additionals is negative: " +this.itemNumber );
         }
         else {
             System.out.println("The number of additionals " +this.itemNumber + " exeeds maximum: " + this.maxAllowedItems  );
             System.out.println("The price will not be calculated. Please reduce the number of selected additionals to " + this.maxAllowedItems +" !");
         }
     }
public void calculatePriceAndShowAdditionals ( boolean lettuce , boolean tomato , boolean carrot , boolean onion , boolean cheese , boolean nachos , boolean paprika ) { this . itemNumber = 0 ; this . price = 0 ; this . lettuce = lettuce ; this . tomato = tomato ; this . carrot = carrot ; this . onion = onion ; this . cheese = cheese ; this . nachos = nachos ; this . paprika = paprika ; System . out . println ( "" ) ; if ( this . lettuce ) { itemNumber ++ ; } if ( this . tomato ) { itemNumber ++ ; } if ( this . carrot ) { itemNumber ++ ; } if ( this . onion ) { itemNumber ++ ; } if ( this . cheese ) { itemNumber ++ ; } if ( this . nachos ) { itemNumber ++ ; } if ( this . paprika ) { itemNumber ++ ; } System . out . println ( "" ) ; System . out . println ( this . name + " burger -> this.maxAllowedItems: " + this . maxAllowedItems ) ; System . out . println ( this . name + " burger -> maxAllowedItems: " + maxAllowedItems ) ; System . out . println ( "" ) ; System . out . println ( "Number of additionals after counting: " + itemNumber ) ; if ( ( this . itemNumber >= 0 ) && ( this . itemNumber <= this . maxAllowedItems ) ) { if ( name . equals ( "base" ) ) { System . out . println ( "The following type of burger was selected: " + this . name ) ; price += this . getBasePrice ( ) ; System . out . println ( "Base price is: " + this . getBasePrice ( ) ) ; } System . out . println ( "Price of " + this . name + " hamburger without additional cost: " + basePrice ) ; price += basePrice ; if ( lettuce ) { price += this . getLettucePrice ( ) ; System . out . println ( "Lettuce: " + this . lettucePrice + " $" ) ; } if ( tomato ) { price += this . getTomatoPrice ( ) ; System . out . println ( "Tomato: " + this . tomatoPrice + " $" ) ; } if ( carrot ) { price += this . getCarrotPrice ( ) ; System . out . println ( "Carrot: " + this . carrotPrice + " $" ) ; } if ( onion ) { price += this . getOnionPrice ( ) ; System . out . println ( "Onion:" + this . onionPrice + " $" ) ; } if ( cheese ) { price += this . getCheesePrice ( ) ; System . out . println ( "Cheese: " + this . cheesePrice + " $" ) ; } if ( nachos ) { price += this . getNachosPrice ( ) ; System . out . println ( "Nachos: " + this . nachosPrice + " $" ) ; } if ( paprika ) { price += this . getPaprikaPrice ( ) ; System . out . println ( "Chips:" + this . paprikaPrice + " $" ) ; } System . out . println ( "Total price of " + this . name + ": " + price + " $" ) ; } else if ( this . itemNumber < 0 ) { System . out . println ( "The number of additionals is negative: " + this . itemNumber ) ; } else { System . out . println ( "The number of additionals " + this . itemNumber + " exeeds maximum: " + this . maxAllowedItems ) ; System . out . println ( "The price will not be calculated. Please reduce the number of selected additionals to " + this . maxAllowedItems + " !" ) ; } }
"Maybe a new method should be created as input generator(type of hamburgers, extras, etc)" Description by Tim Buchalka
" Maybe a new method should be created as input generator ( type of hamburgers extras etc ) " Description by Tim Buchalka
// itemNumber must be reset to 0 at the beginning. (in case of multiple calling of the function)
 // price must be reset to 0 at the beginning.(in case of multiple calling of the function)
 // test for maximum number of allowed items
 // end of test
 //                 System.out.println("Actual price is " + price +" $"); // test
 //                 System.out.println("Actual price is " + price +" $"); // test
 //                 System.out.println("Actual price is " + price +" $"); // test
 //                 System.out.println("Actual price is " + price +" $"); // test
 //                 System.out.println("Actual price is " + price +" $"); // test
 //                 System.out.println("Actual price is " + price +" $"); // test
 //                 System.out.println("Actual price is " + price +" $"); // test
