// Class that holds private fields and methods for menu calculation
class MenuCalculator {

    // Private fields for item prices
    #item1Price = 7.59;
    #item2Price = 9.95;

    // Private fields for item quantities that will be provided by user in 
    // constructor
    #item1Quantity;
    #item2Quantity;

    // Constructor that assings item quantities
    constructor(quantity1, quantity2) {

        this.#item1Quantity = quantity1;
        this.#item2Quantity = quantity2;

    }

    // Method to calculate the total cost of a menu selection
    calculateTotalCost() {

        return ((this.#item1Price * this.#item1Quantity) + 
                (this.#item2Price * this.#item2Quantity));

    }

    // Getter method for totalCost property
    get totalCost() {

        return this.calculateTotalCost();

    }

}

// Create a few MenuCalculator objects with arbitrary values for item 
// quantities
var menu1 = new MenuCalculator(7, 15);
var menu2 = new MenuCalculator(14, 13);
var menu3 = new MenuCalculator(21, 10);

// Output totalCost calculations to console (using toFixed() to limit decimal 
// places)
console.log("Total cost of menu1: $" + menu1.totalCost.toFixed(2));
console.log("Total cost of menu2: $" + menu2.totalCost.toFixed(2));
console.log("Total cost of menu3: $" + menu3.totalCost.toFixed(2));