Introduction to Java & BlueJ — Question 8
Back to all questionsQuestion 8
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.
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

Key Concepts Covered
This question tests your understanding of the following concepts from the chapter Introduction to Java & BlueJ: Question, Create, Program, Generate, Bill, Mcdonald's. These are fundamental topics in Computer Studies that students are expected to master as part of the ICSE Class 8 curriculum.
A thorough understanding of these concepts will help you answer similar questions confidently in your ICSE examinations. These topics are frequently tested in both objective and subjective sections of Computer Studies papers. We recommend revising the relevant section of your textbook alongside practising these solved examples to build a strong foundation.
How to Approach This Question
Read the question carefully and identify what is being asked. Break down complex questions into smaller parts. Use the terminology and concepts discussed in this chapter. Structure your answer logically — begin with a definition or key statement, then provide supporting details. Review your answer to ensure it addresses all parts of the question completely.
Key Points to Remember
- Read the question carefully and identify all parts before answering.
- Use the terminology specific to this subject and chapter.
- Review the textbook content for this chapter before attempting questions.
- Practice writing concise, well-structured answers within time limits.
Practice more questions from Introduction to Java & BlueJ — Computer Studies, Class 8 ICSE