PBLJ eBookAssessments

Sample paper · for practice

CHANDIGARH UNIVERSITY

Bachelor of Engineering — Computer Science & Engineering / Information Technology

MID-SEMESTER TEST I

Project Based Learning in Java — 24CSH-301 / 24ITH-301

Semester: 5th
Syllabus: Unit 1
Time: 1 Hour
Maximum marks: 20
Date:
Roll No.:

Instructions to Candidates

  1. All questions are compulsory.
  2. Section A contains five questions of 2 marks each.
  3. Section B contains two questions of 5 marks each.
  4. Use suitable Java syntax or examples wherever required.

Section A — 2 Mark Questions

5 × 2 = 10 Marks

Answer all questions briefly and precisely.

1.

Explain the role of the static keyword in Java and provide an example demonstrating its usage.

2
2.

Discuss when it is appropriate to use the protected access modifier in Java classes.

2
3.

Explain how Java achieves platform independence.

2
4.

Discuss the role of interfaces in achieving multiple inheritance in Java.

2
5.

Define the throw and throws keywords.

2

Section B — 5 Mark Questions

2 × 5 = 10 Marks

Answer both questions. Include complete Java programs where required.

6.

Implement an abstract class Product with an abstract method calculateDiscount(). Create subclasses Electronics, Clothing, and Furniture. Override the method to calculate discounts according to product category. Display product information and final price after discount.

5
7.

Classify the exception class hierarchy in Java and provide a program to illustrate the handling of unchecked exceptions. Discuss the significance of unchecked exceptions and suitable scenarios where they may arise.

5

— END OF PAPER —

Model answers and the question-wise mark distribution are available on the marking scheme page.