You are on page 1of 9

MARWADI EDUCATION FOUNDATIONS GROUP OF INSTITUTIONS FACULTY OF TECHNOLOGY, GAURIDAD CAMPUS.

DEPARTMENT OF COMPUTER ENGINEERING

Lab Manual
Faculty Name Prof. Madhu Shukla Designation Assistant Professor Subject/ Semester/ Subject code Branch th OOAD / 4 C.E.(FOT) 140703 Lab/ Week 1 (2 Hours)

Purpose of the laboratory


The main goal of this laboratory is to give you an overview of the object oriented programming languages involved in making software, and UML for giving pictorial presentation for overall system which can be easily converted into coding. This manual is optimized for learning UML. Lab sessions are simplified to improve basic understanding of students for analysis, designing which can provide ease of implementations.

How to use/read this manual


This manual is divided into different sections. Each section corresponds to a logical unit in the lab. Each of the sessions is self-explanatory. Students are required to read manual carefully and to have a clear idea of the different concepts that will help them in doing proper analysis of system.

MARWADI EDUCATION FOUNDATIONS GROUP OF INSTITUTIONS FACULTY OF TECHNOLOGY, GAURIDAD CAMPUS.


DEPARTMENT OF COMPUTER ENGINEERING Subject / Subject Code OOAD / 140703 Semester / Branch th 4 C.E.( FOT) Issue Date Due Date

Lab # 1
1. Write a program in C++ which scans any positive integer number and print sum of digit of that number. 2. Write a C++ program for prime number. 3. Draw flowchart for program 1 using MS VISIO TOOL. 4. Draw flowchart for program 2 using MS VISIO TOOL. 5. Create a class called employee that contains a name and an employee number. Include a member function called getdata() to get data from the user for insertion into the object, and another function called putdata() to display the data. Write a main() program to exercise this class. It should create an object of type employee and then invite the user to input the data. Finally, it should print out the data for the employee object.

Prof. Madhu Shukla Subject In-Charge, Computer Engineering Dept. MEFGI

Prof. Jay Teraiya Head of Department, Computer Engineering, MEFGI

MARWADI EDUCATION FOUNDATIONS GROUP OF INSTITUTIONS FACULTY OF TECHNOLOGY, GAURIDAD CAMPUS.


DEPARTMENT OF COMPUTER ENGINEERING

Subject / Subject Code OOAD / 140703

Semester / Branch th 4 C.E.( FOT)

Issue Date

Due Date

Lab # 2
1. Create a class hierarchy to organize the following classes: a. Alcoholic, beer, grape juice, Mineral water, wine, non-alcoholic, soda, whiskey. b. Airplane, bicycle, bike, car, glider, hovercraft, sailboat, scooter, steamer, truck Answer: Vehicles >> water vehicles, road vehicles, air vehicles Water>> hovercraft, sailboat, steamer Road>> bicycle, bike, car, hovercraft, scooter, truck Air>> Airplane, glider c. buffalo, cat, crocodile, cow, donkey, elephant, frog, hippopotamus, penguin, pomfret , tiger, turtle, whale ANSWER: Animals>> terrestrial, aquatic Terrestrial>> elephant, tiger, buffalo, cat, cow, donkey Aquatic>> pomfret, whale Amphibious >> frog, turtle, crocodile, hippopotamus, penguin 2. Prepare a class diagram for each group of classes. Add at least 10 relationships (associations and generalizations) to each diagram. File system, file, ASCII file, binary file, directory file, disc, drive, track, sector. 3. Prepare CLASS model showing at least 10 relationships among the following object classes. Include associations and qualified associations, aggregations, generalizations, and multiplicity. You may add additional objects. Also show attributes and operations. School, playground, principal, school board, classroom, book, student, teacher, canteen, restroom, computer, desk, chair. 4. Prepare a meta model that supports only the following UML concepts: class, attribute, association, association end, multiplicity, class name, and attribute name. Use only these constructs to build meta model. Prof. Madhu Shukla Subject In-Charge, Computer Engineering Dept. MEFGI Prof. Jay Teraiya Head of Department, Computer Engineering, MEFGI

MARWADI EDUCATION FOUNDATIONS GROUP OF INSTITUTIONS FACULTY OF TECHNOLOGY, GAURIDAD CAMPUS.


DEPARTMENT OF COMPUTER ENGINEERING Subject / Subject Code OOAD / 140703 Semester / Branch th 4 C.E.( FOT) Issue Date Due Date

Lab # 3
1. Prepare a class diagram for the dining philosopher problem. There are 5 philosophers and 5 forks around a circular table. Each philosopher has access to 2 forks, one on either side. Each fork is shared by 2 philosophers. Each fork may be either on the table or in use by one philosopher. A philosopher must have 2 forks to eat. 2. Prepare a class diagram for a graphical document editor that supports grouping. Assume that a document consists of several sheets. Each sheet contains drawing objects, including text, geometrical objects and groups. A group is simply a set of drawing objects, possibly including other groups. A group must contain at least two drawing objects. A drawing object can be a direct member of at most one group. Geometrical objects include circles, ellipses, rectangles, lines and squares. 3. Prepare a class model for the hotel management system. The system should supports chain of hotels. A hotel contains two categories of rooms: executive and normal, both AC and non-AC. The customers of executive rooms can avail extra facilities like games, swimming, food service in rooms, etc. The booking is possible by internet or by phone. If the booking is through phone, process is done by receptionist, and if booking is done through internet the process is carried out by customer through hotel website. Depending on the number of days customer stays, appropriate bill is generated. The bill also contains amount for transport, food and other facilities enjoyed by the customer along with necessary taxes. The manager should be able to generate reports like list of customers staying in the hotel, list of rooms empty, monthly/yearly income, etc. 4. Prepare Class Diagram of given project.

Prof. Madhu Shukla Subject In-Charge, Computer Engineering Dept. MEFGI

Prof. Jay Teraiya Head of Department, Computer Engineering, MEFGI

MARWADI EDUCATION FOUNDATIONS GROUP OF INSTITUTIONS FACULTY OF TECHNOLOGY, GAURIDAD CAMPUS.


DEPARTMENT OF COMPUTER ENGINEERING

Subject / Subject Code OOAD / 140703

Semester / Branch th 4 C.E.( FOT)

Issue Date

Due Date

Lab # 4
1. A simple digital watch has a display and two buttons to set it, the A button and the B button. The watch has two modes of operation, display time and set time. In the display time mode, the watch displays hours and minutes, separated by a flashing colon. The set time mode has two sub modes, set hours and set minutes. The A button selects modes. Each time it is pressed, the mode advances in the sequence: display, set hour, set minutes, display, etc. Within the sub modes, the B button advances the hours or minutes once each time it is pressed. Buttons must be released before they can generate another event. Prepare a State diagram of the watch. 2. Prepare State chart diagram for Two Party Phone Call. At the start of a call, the telephone line is idle. When the phone is removed from the hook, it emits a dial tone and can accept the dialing of digits. Upon entry of a valid number, the phone system tries to connect the call and route it to the proper destination. The connection can fail if the number or trunk are busy. If the connection is successful the called phone begins ringing. If the called party answers the phone, a conversation can occur. When the called party hangs up the phone disconnects and rewards to idle when put on hook again. 3. In a personal computer, a disk controller is typically used to transfer a stream of bytes from a floppy disk drive to a memory buffer with the help of a host such as the central processing unit(CPU) or a direct memory access(DMA) controller. Draw state diagram for the control of the data transfer. Add the following to the diagram: reset, indicate data not available, indicate data available, data read by host, new data ready, indicate data lost. 4. Identify states and events for a Photocopier (Zerox) machine from the description given below and draw the state diagram for the same. Initially the machine is off. When the operator switches on the machine, it first warms up during which it performs some internal tests. Once the tests are over, machine is ready for making copies. When operator loads a page to be photocopied and press start button, machine starts making copies according to the number of copies selected. While machine is making copies, machine may go out of paper. Once operator loads sufficient pages, it can start making copies again. During the photocopy process, if paper jam occurs in the machine, operator may need to clean the path by removing the jammed paper to make the machine ready.

MARWADI EDUCATION FOUNDATIONS GROUP OF INSTITUTIONS FACULTY OF TECHNOLOGY, GAURIDAD CAMPUS.


DEPARTMENT OF COMPUTER ENGINEERING

5. Draw state diagram for the control of a telephone answering machine. The machine detects an incoming call on the first ring and answers the call with a prerecorded announcement. When the announcement is complete, the machine records the callers message. When the caller hands up, the machine hangs up and shuts off. Place the following in the diagram: call detected, answer call, play announcement, record message, caller hangs up, announcement complete. 6. Draw the one shot diagram for the chess game. 7. Prepare State chart diagram(s) of given project.

Prof. Madhu Shukla Subject In-Charge, Computer Engineering Dept. MEFGI

Prof. Jay Teraiya Head of Department, Computer Engineering, MEFGI

MARWADI EDUCATION FOUNDATIONS GROUP OF INSTITUTIONS FACULTY OF TECHNOLOGY, GAURIDAD CAMPUS.


DEPARTMENT OF COMPUTER ENGINEERING Subject / Subject Code OOAD / 140703 Semester / Branch th 4 C.E.( FOT) Issue Date Due Date

Lab # 5
1. Draw the use-case diagram for Hotel Information System. There are two types of customers: Tour-group customers and Individual customers. Both can book, cancel, check-in and check-out of a room by Phone or via the Internet. There are booking process clerk and reception staff who manages it. A customer can pay his bill by credit card or pay utility bill. 2. Consider the following system for Online Theatre Booking (for multiplex). Following are the minimum requirement of the system from the perspective of a user who is going to use this online system. User should be a registered member. User can book any number of tickets on availability. User should be able to search for the availability of tickets on selecting a particular movie. Once user books the ticket a token number will be generated so that on providing this token he will be able to collect tickets before show from theatre premises. User can cancel all or some seats of the ticket by providing token number before 1 Hr of scheduled time for that movie. Identify the actors for the application and draw the use case diagram. 3. Draw the use-case diagram for Online Admission Process for Engineering Students in Gujarat. 4. Consider an online airline reservation system. a. List two actors. Explain the relevance of each actor. b. Prepare a use case diagram for an online reservation system. 5. Draw use case diagram for given project.

Prof. Madhu Shukla Subject In-Charge, Computer Engineering Dept. MEFGI

Prof. Jay Teraiya Head of Department, Computer Engineering, MEFGI

MARWADI EDUCATION FOUNDATIONS GROUP OF INSTITUTIONS FACULTY OF TECHNOLOGY, GAURIDAD CAMPUS.


DEPARTMENT OF COMPUTER ENGINEERING Subject / Subject Code OOAD / 140703 Semester / Branch th 4 C.E.( FOT) Issue Date Due Date

Lab # 6
1. Prepare a scenario for the following situation: Once upon a time a farmer went to market and purchased a fox, a goose, and a bag of beans. On his way home, the farmer came to the bank of a river and hired a boat. But in crossing the river by boat, the farmer could carry only himself and a single one of his purchases - the fox, the goose, or the bag of the beans. If left alone, the fox would eat the goose, and the goose would eat the beans. Prepare two scenarios, one in which something gets eaten and one in which everything is safely transported across the river. 2. Prepare a sequence diagram for a computer email system. 3. Prepare a sequence diagram for reserving room when online room reservation system is used. 4. The vending machine delivers a beverage after a customer selects and pays for it. The machine starts in the waiting state in which it displays the message Enter coins. When the customer inserts coins into the machine, the machine displays total value of money entered. The customer pushes a button. The machine dispenses a corresponding item and make change, if the cost of the item is less than the money inserted. If the cost of the item is greater than money inserted, the machine shows the message as Insufficient money. Draw the sequence diagram for above description. 5. Prepare sequence diagram(s) for given project.

Prof. Madhu Shukla Subject In-Charge, Computer Engineering Dept. MEFGI

Prof. Jay Teraiya Head of Department, Computer Engineering, MEFGI

MARWADI EDUCATION FOUNDATIONS GROUP OF INSTITUTIONS FACULTY OF TECHNOLOGY, GAURIDAD CAMPUS.


DEPARTMENT OF COMPUTER ENGINEERING Subject / Subject Code OOAD / 140703 Semester / Branch th 4 C.E.( FOT) Issue Date Due Date

Lab # 7
1. Prepare an activity diagram for computing a restaurant bill. There should be a charge for each delivered item. The total amount should be subject to tax and service charge of 18% for groups of six or more. Any coupons charge submitted by the customer is subtracted from bill. 2. A customer decides to upgrade her PC and purchase a DVD player. She begins by calling the sales department of PC vendor and they tell her to contact customer support. She than calls customer support and they put her on hold while talking to engineering. Finally, customer support tells the customer about several supported DVD options. The customer chooses a DVD and it is shipped by the mail department. The customer receives the DVD , installs it satisfactorily and then mails her payment to accounts department. Draw the activity diagram for above description. 3. A soft drink vending machine accepts coins for a variety of products. When the amount of money deposited into the machine is equal to or greater than the price of any of its available products, the respective product selection buttons will be enabled for the user to make the selection. After the user has made a valid selection, the machine will dispense the soft drink, together with the change (if applicable). Draw the Activity Diagram for this vending machine. 4. Prepare Activity diagram(s) for given project.

Prof. Madhu Shukla Subject In-Charge, Computer Engineering Dept. MEFGI

Prof. Jay Teraiya Head of Department, Computer Engineering, MEFGI

You might also like