Computer Science, asked by shamilashamu55, 1 year ago

Create a Java program that will generate a bill at McDonald's for four vegetable burger (@rs 45 per vegetable burger) and three vegetable McPuffs(@rs25 per vegetable mcpuffs) There is a special Independence Day discounts of rs50 on the final bill amount.

Answers

Answered by mebijay
26

public class Main {

   public static void main(String[] args) {

       int totalPrice = 45 + ( 3 * 25);

       

       //After Discount

       

       totalPrice -= 50;

       

       System.out.println("Total Bill = " + totalPrice);

   }

}

Answered by Anonymous
39

CODE :


class Bill

{

public static void main(String args[])

{

int mcd=45*4;

int mcp=25*3;

int price=mcd+mcp;

int dis=50;

int final=price-dis;

System.out.println("Final bill amount="+final);

}

}


NOTE:

⇒ First multiply 45 with 4 .

⇒ Then multiply 25 with 3 .

⇒ Then add the two and subtract the discount of 50.

⇒ Then finally print it .


Thanks !

______________________________________________________________

Similar questions