Programming Examples

Create a program that will generate a bill at McDonald based on given details


Create a program that will generate b 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.

Solution

class McDonald
{
    public static void main(String arr[])
    {
        int burger=45,mc_puffs=25,bill,final_bill;
        bill=(burger*4)+(mc_puffs*3);
        final_bill=bill-50;
        System.out.println("Burger @"+burger+"x4 ="+(burger*4)+" Rs.");
        System.out.println("McPuffs @"+mc_puffs+"x3 ="+(mc_puffs*3)+" Rs.");
        System.out.println("Total "+bill+" Rs.");
        System.out.println("Discount 50 Rs");
        System.out.println("Final Amount : "+final_bill+" Rs.");
    }
}
Output

Burger @45x4 =180 Rs.

McPuffs @25x3 =75 Rs.

Total 255 Rs.

Discount 50 Rs

Final Amount : 205 Rs.

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz