You are on page 1of 1

Birla Institute of Technology & Science, Pilani Distance Learning Programmes Division Second Semester 2006-2007 Mid-Semester Test

(EC-1 Regular) Course No. Course Title Nature of Exam Weightage Duration Date of Exam Note:
1. 2. 3. 4.

: BITS ZC411 : OBJECT ORIENTED PROGRAMMING : Closed Book : 40% : 2 Hours : 03/02/2007 (FN)

No. of Pages =1 No. of Questions = 3

Please follow all the Instructions to Candidates given on the cover page of the answer book. All parts of a question should be answered consecutively. Each answer should start from a fresh page. Mobile phones and computers of any kind should not be brought inside the examination hall. Use of any unfair means will result in severe disciplinary action.

Q.1.

We need to compute the Course Grade for a Student in a course. For the course, there will be three tests (20 marks each) and one Final test (40 marks). There can be only two grades possible (i.e. A and B). For an Undergraduate student, average+20 is A grade (else B) and for a Graduate student, average + 30 is A grade (else B). Each Student is identified by Name and Idno. Write proper get and set methods. Write the Driver Class (Test Class with main method) to compute grades for both kinds of students. Assume Average for the Course is 55. [Hint: Use Inheritance, Abstract Class and Method Overriding] [10] Consider a Bill class that is a part of larger Billing System for say a grocery store. A Bill has a Bill Number (unique across the system), a customer name, bill date and a list of items (with their prices and quantities). For simplicity assume, a maximum of ten items are there per Bill. Write the Bill class along with following methods. (a). (b). (c). (d). Constructor (String customerName, String date) Void addItem(String itemName, int price,int qty) int getTotal() void printToScreen()

Q.2.

[10]

Q.3.

You have to provide an OO design for airplane reservation system. Assume that each airplane has 20 seats in first class (5 rows of 4 seats each, separated by an aisle) and 180 seats in economy class (30 rows of 6 seats each, separated by an aisle). A person can book a ticket for one or more passengers, and cancel the trip for a particular passenger (If the ticket contains more passengers a new ticket will be issued with the same ticket number, but without the name of this particular passenger). At the time of reservation the person who is booking the ticket has to provide the following information: the names of the passengers, address, phone number, boarding point and to which city they are fling to, flight number , the date of journey and the seating preference (aisle or window in first class; aisle, center or window in economy). If the seats are available, but the available preferences are not matching with the preferences that are demanded by the passengers, an appropriate message is appeared on the screen. At this stage either ticket can be booked with the available preferences or ticket may not be booked, according to the wish of the booker. If seats are not available and if the booker is ready to book the ticket in waiting list, the system provides a waiting list number for each passenger. As the seats are cancelled, the system allots the seats to the waiting list passengers in first-come-first-serve-manner. Preferences can not be given for the waiting list passengers. (a). (b). (c). (d). Find out all the relevant classes. Write statement of purpose for each class. Write down all the use cases. Draw a UML class diagram. Draw Sequence and State diagram for the above systems. ********

[5 x 4 = 20]

You might also like