SlideShare a Scribd company logo
1 of 2
Download to read offline
LAB 2-INTRODUCTION
                                 BS-III (ADVANCED S/W ENG.)

Object-Oriented Concepts

Attribute: the basic data of the class.

Method (operation): an executable procedure that is encapsulated in a class and is designed to
   operate on one or more data attributes that are defined as part of the class.

Object: when specific values are assigned to all the resources defined in a class, the result is an
   instance of that class. Any instance of any class is called an object.

Discovering Classes
Discovering and defining classes to describe the structure of a computerized system is not an
   easy task. When the problem domain is new or unfamiliar to the software developers it can
   be difficult to discover classes; a cookbook for finding classes does not exist.

Classes Categories
Classes are divided into three categories:

Entity: models information and associated behavior that is long-lived, independent of the
   surrounding, application independent, and accomplishes some responsibility
Boundary: handles the communication between the system surroundings and the inside of the
   system, provides interface, and facilitates communication with other systems
Control: model sequencing behavior specific to one or more use cases. Control classes
   coordinate the events needed to realize the behavior specified in the usecase, and they are
   responsible for the flow of events in the use case


Exercise 1(identification of classes)

   Consider the following requirements for the Video Store system. Identify the candidate
   classes: The video store keeps in stock an extensive library of current and popular movie
   titles. A particular movie may be held on video tape or disk. Video tapes are in either "Beta"
   or "VHS" format. Video disks are in DVD format. Each movie has a particular rental period
   (expressed in days), with a rental charge to that period. The video store must be able to
   immediately answer any inquiries about a movie's stock availability and how many tapes
   and/or disks are available for rental. The current condition of each tape and disk must be
   known and recorded. The rental charge differs depending on video medium: tape or disk (but
   it is the same for the two categories of tapes: Beta and VHS).The system should accommodate
   future video storage formats in addition to VHStapes, Beta tapes and DVD disks. The
   employees frequently use a movie code, instead of movie title, to identify the movie. The
   same movie title may have more than one release by different directors. You may use any (or
   mix) of the class elicitation methods to find the candidate classes.
Following two exercises are the programming assignments to assess the student’s ability:

Programming assignment 1

   Create an inheritance hierarchy of Vehicle: Car, Bus and Truck, with the School Bus further
   extending the hierarchy through the Bus. Each of the derived class objects should be
   packaging information about category and passenger carrying capacity of that vehicle.
   Provide a method that is common to all derived classes, such as getPassengerCapacity (),
   with class Truck having an additional method called getLoadingCapacity () that should be
   returning that truck's loading capacity in tons. Create objects of all the derived classes in a
   test class and store the references in an array (4 Elements) of type Vehicle, the top-level class
   of this hierarchy. Provide logic so that at every run of the program any one of the four
   references stored in the array is randomly selected and the methods of that object are called
   polymorphically. Every random access must result in display of category and passenger
   carrying capacity of that particular vehicle, except in the case of a Truck object, where the
   call must result in the display of category, passenger carrying capacity and the cargo loading
   capacity.

Programming assignment 2

    In this assignment you are required to do some string processing. Consider the English word
   "CONTAMINATION". This word consists of 13 letters. However, some of the letters occur
   more than once. There are ONLY 7 DISTINCT letters occurring in the string which are {A,
   C, I, M, N, O, T}. So, although, the total number of letters in the word is 13, there are ONLY
   7 DISTINCT letters of the English alphabet in the string. Similarly, consider the word
   "RETREAT". It consists of 7 letters. However, there are only 4 DISTINCT letters in it which
   are {A, E, R, T}. Similarly the word "NEEDLE" consists of 6 letters but it contains ONLY 4
   DISTINCT letters which are {D, E, L, E}. Now consider the word "FLASHING". It consists
   of 8 letters. But since no letter is repeated, the number of DISTINCT letters occurring in it is
   ALSO 8. Similarly the number of DISTINCT letters occurring in the word "PROMISE" is
   the SAME (7) as the TOTAL number of letters occurring in it.

   Write program which inputs a word (having not more than 15 letters) from the
   keyboard and displays the number of DISTINCT letters occurring in it.

More Related Content

What's hot

Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Languagedheva B
 
Class notes(week 7) on packages
Class notes(week 7) on packagesClass notes(week 7) on packages
Class notes(week 7) on packagesKuntal Bhowmick
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programmingAmit Soni (CTFL)
 
C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS ConceptBoopathi K
 
Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4MOHIT TOMAR
 
Oop concepts classes_objects
Oop concepts classes_objectsOop concepts classes_objects
Oop concepts classes_objectsWilliam Olivier
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programmingumairrajpoot6
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .NetGreg Sohl
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oopcolleges
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]Rome468
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPTAjay Chimmani
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming ConceptsAbhigyan Singh Yadav
 
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...Simplilearn
 

What's hot (20)

Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
 
Class notes(week 7) on packages
Class notes(week 7) on packagesClass notes(week 7) on packages
Class notes(week 7) on packages
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
C++ OOPS Concept
C++ OOPS ConceptC++ OOPS Concept
C++ OOPS Concept
 
Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4
 
Concepts of oops
Concepts of oopsConcepts of oops
Concepts of oops
 
Oop concepts classes_objects
Oop concepts classes_objectsOop concepts classes_objects
Oop concepts classes_objects
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oop
 
Object oriented concepts
Object oriented conceptsObject oriented concepts
Object oriented concepts
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]
 
SEMINAR
SEMINARSEMINAR
SEMINAR
 
Oops in vb
Oops in vbOops in vb
Oops in vb
 
Smali语法
Smali语法Smali语法
Smali语法
 
Oops
OopsOops
Oops
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
 

Viewers also liked

Software Engineering Lab Manual
Software Engineering Lab ManualSoftware Engineering Lab Manual
Software Engineering Lab ManualNeelamani Samal
 
Student Information System ( S.I.S. )
Student Information System ( S.I.S.  )Student Information System ( S.I.S.  )
Student Information System ( S.I.S. )Pulkiŧ Sharma
 
Software engineering presentation
Software engineering presentationSoftware engineering presentation
Software engineering presentationMJ Ferdous
 
Face recognition ppt
Face recognition pptFace recognition ppt
Face recognition pptSantosh Kumar
 

Viewers also liked (6)

Software engineering
Software engineeringSoftware engineering
Software engineering
 
Software Engineering Lab Manual
Software Engineering Lab ManualSoftware Engineering Lab Manual
Software Engineering Lab Manual
 
face recognition
face recognitionface recognition
face recognition
 
Student Information System ( S.I.S. )
Student Information System ( S.I.S.  )Student Information System ( S.I.S.  )
Student Information System ( S.I.S. )
 
Software engineering presentation
Software engineering presentationSoftware engineering presentation
Software engineering presentation
 
Face recognition ppt
Face recognition pptFace recognition ppt
Face recognition ppt
 

Similar to Advanced software engineering lab 2

Question and answer Programming
Question and answer ProgrammingQuestion and answer Programming
Question and answer ProgrammingInocentshuja Ahmad
 
Selenium Training .pptx
Selenium Training .pptxSelenium Training .pptx
Selenium Training .pptxSajidTk2
 
OOP, Networking, Linux/Unix
OOP, Networking, Linux/UnixOOP, Networking, Linux/Unix
OOP, Networking, Linux/UnixNovita Sari
 
Bt0082, visual basic
Bt0082, visual basicBt0082, visual basic
Bt0082, visual basicsmumbahelp
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Examshishamrizvi
 
Paradigms.pptx
Paradigms.pptxParadigms.pptx
Paradigms.pptxaikomo1
 
Root cause of community problem for this discussion, you will i
Root cause of community problem for this discussion, you will iRoot cause of community problem for this discussion, you will i
Root cause of community problem for this discussion, you will issusere73ce3
 
Object oriented software engineering
Object oriented software engineeringObject oriented software engineering
Object oriented software engineeringVarsha Ajith
 
In this page, we will learn about the basics of OOPs. Object-Oriented Program...
In this page, we will learn about the basics of OOPs. Object-Oriented Program...In this page, we will learn about the basics of OOPs. Object-Oriented Program...
In this page, we will learn about the basics of OOPs. Object-Oriented Program...Indu32
 
1 Project 2 Introduction - the SeaPort Project seri.docx
1  Project 2 Introduction - the SeaPort Project seri.docx1  Project 2 Introduction - the SeaPort Project seri.docx
1 Project 2 Introduction - the SeaPort Project seri.docxhoney725342
 

Similar to Advanced software engineering lab 2 (20)

E4
E4E4
E4
 
Question and answer Programming
Question and answer ProgrammingQuestion and answer Programming
Question and answer Programming
 
Java mcq
Java mcqJava mcq
Java mcq
 
Selenium Training .pptx
Selenium Training .pptxSelenium Training .pptx
Selenium Training .pptx
 
Delphi qa
Delphi qaDelphi qa
Delphi qa
 
Unit 3
Unit 3Unit 3
Unit 3
 
OOP, Networking, Linux/Unix
OOP, Networking, Linux/UnixOOP, Networking, Linux/Unix
OOP, Networking, Linux/Unix
 
Class 1 blog
Class 1 blogClass 1 blog
Class 1 blog
 
Bt0082, visual basic
Bt0082, visual basicBt0082, visual basic
Bt0082, visual basic
 
Oop
OopOop
Oop
 
My c++
My c++My c++
My c++
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
 
Java notes jkuat it
Java notes jkuat itJava notes jkuat it
Java notes jkuat it
 
Java notes(OOP) jkuat IT esection
Java notes(OOP) jkuat IT esectionJava notes(OOP) jkuat IT esection
Java notes(OOP) jkuat IT esection
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
 
Paradigms.pptx
Paradigms.pptxParadigms.pptx
Paradigms.pptx
 
Root cause of community problem for this discussion, you will i
Root cause of community problem for this discussion, you will iRoot cause of community problem for this discussion, you will i
Root cause of community problem for this discussion, you will i
 
Object oriented software engineering
Object oriented software engineeringObject oriented software engineering
Object oriented software engineering
 
In this page, we will learn about the basics of OOPs. Object-Oriented Program...
In this page, we will learn about the basics of OOPs. Object-Oriented Program...In this page, we will learn about the basics of OOPs. Object-Oriented Program...
In this page, we will learn about the basics of OOPs. Object-Oriented Program...
 
1 Project 2 Introduction - the SeaPort Project seri.docx
1  Project 2 Introduction - the SeaPort Project seri.docx1  Project 2 Introduction - the SeaPort Project seri.docx
1 Project 2 Introduction - the SeaPort Project seri.docx
 

More from asimnawaz54

Lecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceLecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceasimnawaz54
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceasimnawaz54
 
Expert systems with applications
Expert systems with applicationsExpert systems with applications
Expert systems with applicationsasimnawaz54
 
Establishing knowledge base
Establishing knowledge baseEstablishing knowledge base
Establishing knowledge baseasimnawaz54
 
Designing the expert system
Designing the expert systemDesigning the expert system
Designing the expert systemasimnawaz54
 
1 s2.0-s0957417410007244-main
1 s2.0-s0957417410007244-main1 s2.0-s0957417410007244-main
1 s2.0-s0957417410007244-mainasimnawaz54
 
Packet switching
Packet switchingPacket switching
Packet switchingasimnawaz54
 
Network layer and circuit switching
Network layer and circuit switchingNetwork layer and circuit switching
Network layer and circuit switchingasimnawaz54
 
Network layer and circuit switching
Network layer and circuit switchingNetwork layer and circuit switching
Network layer and circuit switchingasimnawaz54
 
Internet control message protocol
Internet control message protocolInternet control message protocol
Internet control message protocolasimnawaz54
 
Address resolution protocol
Address resolution protocolAddress resolution protocol
Address resolution protocolasimnawaz54
 
Address resolution protocol and internet control message protocol
Address resolution protocol and internet control message protocolAddress resolution protocol and internet control message protocol
Address resolution protocol and internet control message protocolasimnawaz54
 
Requirements analysis
Requirements analysisRequirements analysis
Requirements analysisasimnawaz54
 
Object oriented analysis lab1
Object oriented analysis lab1Object oriented analysis lab1
Object oriented analysis lab1asimnawaz54
 
Ooad sequence diagram lecture
Ooad sequence diagram lectureOoad sequence diagram lecture
Ooad sequence diagram lectureasimnawaz54
 

More from asimnawaz54 (17)

Lecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceLecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inference
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
 
Expert systems with applications
Expert systems with applicationsExpert systems with applications
Expert systems with applications
 
Establishing knowledge base
Establishing knowledge baseEstablishing knowledge base
Establishing knowledge base
 
Designing the expert system
Designing the expert systemDesigning the expert system
Designing the expert system
 
1 s2.0-s0957417410007244-main
1 s2.0-s0957417410007244-main1 s2.0-s0957417410007244-main
1 s2.0-s0957417410007244-main
 
Packet switching
Packet switchingPacket switching
Packet switching
 
Network layer and circuit switching
Network layer and circuit switchingNetwork layer and circuit switching
Network layer and circuit switching
 
Network layer and circuit switching
Network layer and circuit switchingNetwork layer and circuit switching
Network layer and circuit switching
 
Ipv6up
Ipv6upIpv6up
Ipv6up
 
Ipv4
Ipv4Ipv4
Ipv4
 
Internet control message protocol
Internet control message protocolInternet control message protocol
Internet control message protocol
 
Address resolution protocol
Address resolution protocolAddress resolution protocol
Address resolution protocol
 
Address resolution protocol and internet control message protocol
Address resolution protocol and internet control message protocolAddress resolution protocol and internet control message protocol
Address resolution protocol and internet control message protocol
 
Requirements analysis
Requirements analysisRequirements analysis
Requirements analysis
 
Object oriented analysis lab1
Object oriented analysis lab1Object oriented analysis lab1
Object oriented analysis lab1
 
Ooad sequence diagram lecture
Ooad sequence diagram lectureOoad sequence diagram lecture
Ooad sequence diagram lecture
 

Advanced software engineering lab 2

  • 1. LAB 2-INTRODUCTION BS-III (ADVANCED S/W ENG.) Object-Oriented Concepts Attribute: the basic data of the class. Method (operation): an executable procedure that is encapsulated in a class and is designed to operate on one or more data attributes that are defined as part of the class. Object: when specific values are assigned to all the resources defined in a class, the result is an instance of that class. Any instance of any class is called an object. Discovering Classes Discovering and defining classes to describe the structure of a computerized system is not an easy task. When the problem domain is new or unfamiliar to the software developers it can be difficult to discover classes; a cookbook for finding classes does not exist. Classes Categories Classes are divided into three categories: Entity: models information and associated behavior that is long-lived, independent of the surrounding, application independent, and accomplishes some responsibility Boundary: handles the communication between the system surroundings and the inside of the system, provides interface, and facilitates communication with other systems Control: model sequencing behavior specific to one or more use cases. Control classes coordinate the events needed to realize the behavior specified in the usecase, and they are responsible for the flow of events in the use case Exercise 1(identification of classes) Consider the following requirements for the Video Store system. Identify the candidate classes: The video store keeps in stock an extensive library of current and popular movie titles. A particular movie may be held on video tape or disk. Video tapes are in either "Beta" or "VHS" format. Video disks are in DVD format. Each movie has a particular rental period (expressed in days), with a rental charge to that period. The video store must be able to immediately answer any inquiries about a movie's stock availability and how many tapes and/or disks are available for rental. The current condition of each tape and disk must be known and recorded. The rental charge differs depending on video medium: tape or disk (but it is the same for the two categories of tapes: Beta and VHS).The system should accommodate future video storage formats in addition to VHStapes, Beta tapes and DVD disks. The employees frequently use a movie code, instead of movie title, to identify the movie. The same movie title may have more than one release by different directors. You may use any (or mix) of the class elicitation methods to find the candidate classes.
  • 2. Following two exercises are the programming assignments to assess the student’s ability: Programming assignment 1 Create an inheritance hierarchy of Vehicle: Car, Bus and Truck, with the School Bus further extending the hierarchy through the Bus. Each of the derived class objects should be packaging information about category and passenger carrying capacity of that vehicle. Provide a method that is common to all derived classes, such as getPassengerCapacity (), with class Truck having an additional method called getLoadingCapacity () that should be returning that truck's loading capacity in tons. Create objects of all the derived classes in a test class and store the references in an array (4 Elements) of type Vehicle, the top-level class of this hierarchy. Provide logic so that at every run of the program any one of the four references stored in the array is randomly selected and the methods of that object are called polymorphically. Every random access must result in display of category and passenger carrying capacity of that particular vehicle, except in the case of a Truck object, where the call must result in the display of category, passenger carrying capacity and the cargo loading capacity. Programming assignment 2 In this assignment you are required to do some string processing. Consider the English word "CONTAMINATION". This word consists of 13 letters. However, some of the letters occur more than once. There are ONLY 7 DISTINCT letters occurring in the string which are {A, C, I, M, N, O, T}. So, although, the total number of letters in the word is 13, there are ONLY 7 DISTINCT letters of the English alphabet in the string. Similarly, consider the word "RETREAT". It consists of 7 letters. However, there are only 4 DISTINCT letters in it which are {A, E, R, T}. Similarly the word "NEEDLE" consists of 6 letters but it contains ONLY 4 DISTINCT letters which are {D, E, L, E}. Now consider the word "FLASHING". It consists of 8 letters. But since no letter is repeated, the number of DISTINCT letters occurring in it is ALSO 8. Similarly the number of DISTINCT letters occurring in the word "PROMISE" is the SAME (7) as the TOTAL number of letters occurring in it. Write program which inputs a word (having not more than 15 letters) from the keyboard and displays the number of DISTINCT letters occurring in it.