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.
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
Related Questions
Write a program to calculate the tax for a taxable income of Rs. 4,10,000, if the tax rate is fixed at 3.2%.
Write a program to find the sum and average of three numbers.
Write a program to interchange the value of two numbers without using the third variable.
Write a program to calculate the compound interest.