Sort by

recency

|

45 Discussions

|

  • + 0 comments

    To calculate the fixed profit in each scenario, you compare the combined price of a burger and soda with the price of the combo meal. The difference between the combo price and the individual items, divided by two, gives the fixed profit. This method can be applied to any fast-food menu, such as the one at rocomamasmenu, to determine the profit margin on their items.

  • + 0 comments

    Great discussion. I hope this would help me with https://cavamenuprice.com/cava-houston-heights-menu/

  • + 0 comments

    c#

    public static int profit(int b, int s, int c)

    {
    // Return the fixed profit.
        int markup = (b+s-c);
        return markup;
        Console.WriteLine(markup);
    }
    
  • + 0 comments

    Javascript -- rewrote main() function instead

    function main() {
        const ws = fs.createWriteStream(process.env.OUTPUT_PATH);
        ws.write(Array(+readLine()).fill().map(_ => readLine().split(' ').map(x => +x)).map(x => x[1] - x[2] + x[0]).join('\n'));
        ws.end();
    }
    
  • + 0 comments

    my solution to this problem

    the variable is just a random name.

    def profit(b, s, c):
        ads= b+s-c
        return ads