Computer Applications

Create a program that will generate a bill at McDonald's for four vegetable burgers (@ Rs 45 per vegetable Burger) and three vegetable McPuffs (@ Rs 25 per vegetable McPuff). There is a special Independence Day discount of Rs 50 on the final bill amount.

Java

Java Intro

57 Likes

Answer

public class KboatMcDBill
{
    public static void main(String args[]) {
        int vegBurgerCost = 4 * 45;
        int vegMcPuffCost = 3 * 25;
        int total = vegBurgerCost + vegMcPuffCost;
        int amt = total - 50;
        System.out.println("4 Vegetable Burgers @ 45 = " + vegBurgerCost);
        System.out.println("3 Vegetable McPuffs @ 25 = " + vegMcPuffCost);
        System.out.println("Total = " + total);
        System.out.println("Discount = 50");
        System.out.println("Final Bill = " + amt);
    }
}

Output

Answered By

25 Likes


Related Questions