Introduction 9036

Embed Size (px)

Citation preview

  • 8/6/2019 Introduction 9036

    1/12

    A Laboratory Manual for

    Object Oriented Programming

    (9036)

    Semester - III

    (Computer Group)

    Maharashtra State

    Board of Technical Education, Mumbai

    Diploma in Engineering and Technology Courses

  • 8/6/2019 Introduction 9036

    2/12

    2006, Maharashtra State Board of Technical Education,

    49, Kherwadi, Aliyawar Jung Marg, Bandra (East), Mumbai - 400 051, Maharashtra State, India.

    Any part of this Laboratory Manual may not be reproduced in any form or by any means withoutpermission in writing from MSBTE Mumbai.

    Education Technology Shri. D. M. MakoneConsultant Ex. Secretary

    M.S.B.T.E., Mumbai - 400 051.

    Project Institution Sri Savitribai Phule Polytechnicsurvey no.124,Ex-serviceman Colony,MIT College Campus,Paud Road, Kothrud Pune -411038.

    Project Period Sept 2006 -Nov 2006

    Chief Project Coordinator Smt. R. S. KaleSri Savitribai Phule Polytechnic,survey no.124,Ex-serviceman Colony,MIT College Campus,Paud Road, Kothrud Pune -411038. : (O) 25431795 Ext:521

    Project Coordinator Smt. S. H. KulkarniSri Savitribai Phule Polytechnic, Pune -411038.

    Subject Experts 1. Smt. H.Y.Gawali

    Sri Savitribai Phule Polytechnic, Pune - 411038.

    2. Mr. S.U.KadamEklavya Polytechnic, Pune- 411038.

    Designations Team for design

    CURRICULUM DEVELOPMENT CELL, MSBTE, MUMBAI.

    LABORATORY MANUAL DEVELOPMENT PROJECT

  • 8/6/2019 Introduction 9036

    3/12

    MAHARASHTRA STATE BOARD OF

    TECHNICAL EDUCATION

    Certificate

    This is to certify that Mr. / Ms. .. Roll No.

    , of Third Semester of Diploma in

    has completed the term work satisfactorily

    in Object Oriented Programming (9036) for the academic year 20 to

    20 as prescribed in the curriculum.

    Place : .. Enrolment No.: ..

    Date : ... Exam. Seat No. : ..

    ( ) ( )Subject Teacher Head of the Department Principal

    Seal of

    Institution

  • 8/6/2019 Introduction 9036

    4/12

  • 8/6/2019 Introduction 9036

    5/12

    MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION 5

    Object Oriented Programming

    LEARNING OVERVIEW

    IMPORTANCE OF THE SUBJECT

    OOPS has continued to grow in popularity, and many companies use it as their development tool.

    This concept is useful for constructing complex and critical physical systems such as missiles, aeroplanesetc. There are various object oriented programming languages, from these C++ is widely used language.

    The study of this subject will enable the students to develop programs on basic concepts of OOPS likeclasses and objects, polymorphism, inheritance etc.

    SUBJECT OBJECTIVES

    The Students will be able to

    1. Write programs using objects and classes.

    2. Develop programs to create and destroy the objects.

    3. Use existing operators for different meanings.

    4. Using reusability concept.

    5. Implement pointers for arrays, strings and object.

    6. Describe polymorphism, concepts, it's types, virtual function and write program for same.

    7. Apply formatted and unformatted console I/O operation and perform file related activities using C++streams.

    i

  • 8/6/2019 Introduction 9036

    6/12

    6 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

    Object Oriented Programming

    ii

    LEARNING STRUCTURE

    FOR THE SUBJECTObject Oriented Programming

    (SEMESTER -II)

  • 8/6/2019 Introduction 9036

    7/12

    MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION 7

    Object Oriented Programming

    ii i

    DEVELOPMENT OF SKILLS

    This Lab Manual intends to develop the intellectual and motor skills of student. The skills mentioned belowwill be developed through the experiments performed in this laboratory.

    Intellectual skills:

    I-1 : Understanding / Identifying the concepts.

    I-2 : Ability to Discriminate / Classify.

    I-3 : Ability to Investigate / Test / Verify properties or characteristics.

    I-4 : Ability to Interpret program output.

    I-5 : Ability to debug and edit programs.

    I-6 : Ability to develop programs.

    Motor Skills:

    M-1 : Skill to handle computer peripherals.M-2 : Skill to indent program.

    In order to develop these skills for each experiment, important skills have been identified. While performingthe experiment, it is necessary to focus on such important skills. Following table shows a grid of experimentsand relevant skills.

    GRID TABLE

    No. I1 I2 I3 I4 I5 I6 M1 M2

    1 Program to Input and Output data for

    finding area of rectangle.

    2 Program to declare structure and

    create array of structure variables with

    sample of library books.

    3 Program to create an object of class

    taking student record as sample class.

    4 Program to create an array of objects

    taking student as sample class.

    5 Program to access static member

    variables.

    6 Program to find out square of a

    number using friend function.

    7 Program to define class using

    constructor and destructor taking

    distance as sample class.

    8 Program for finding simple interest

    using constructor with default

    arguments9 Program to overload unary and binary

    operators.

    Sr. Title of the experiment Intellectual skills Motor skills

  • 8/6/2019 Introduction 9036

    8/12

    8 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

    Object Oriented Programming

    NOTE : Identified Skills

    STRATEGY FOR IMPLEMENTATION

    It is suggested that the total experiments shall be accommodated in the periods (working hours)

    available in the semester.

    Teaching and examination scheme

    # Indicates Assessment by external examiner.

    @ Indicates assessment by internal examine

    iv

    10 Program to implement single and

    multilevel inheritance taking employee

    as sample base class.

    11 Program to implement multiple

    inheritance and virtual base class forcalculating area of any shape.

    12 Program to pass an entire array to

    the function using pointer to an array

    of integer

    13 Program for finding length of string

    using pointers to string.

    14 Program for pointer to object taking

    Product as sample class.

    15 Program for this pointer to access

    members of the current object.

    16 Program for run time polymorphism

    ( Virtual function ).

    17 Program for function overloading for

    finding area of circle and rectangle.

    18 Program for formatting output using

    manipulators.

    19 Program for file processing.

    20 Mini project

  • 8/6/2019 Introduction 9036

    9/12

    MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION 9

    Object Oriented Programming

    GUIDELINES FOR TEACHERS

    Teacher shall discuss the following points with students before start of experiments of the subject.

    1. Learning Overview : To develop better understanding of importance of the subject. To know relatedskills to be developed such as Intellectual skills and Motor skills.

    2. Learning Structure : In this, topics and sub topics are organized in systematic way so that ultimate

    purpose of learning the subject is achieved. This is arranged in the form of fact, concept, principle,procedure, application and problem.

    3. Know your Laboratory Work : To understand the layout of laboratory, specifications of Equipment/ Instruments / Software, procedure, working in groups, planning time etc. Also to know total amountof work to be done in the laboratory.

    4. Teacher shall ensure that required equipments are in working condition before start of experiment,also keep operating instruction manual available.

    5. Explain prior concepts to the students before starting of each experiment.

    6. Involve students activity at the time of conduct of each experiment.7. List of questions is given at the end of each experiment. Teacher shall instruct the students to

    attempt all questions given at the end of each experiment / exercise. Teacher shall ensure that eachstudent writes the answers to the allotted questions in the laboratory manual after performance isover.

    8. If the experimental set up has variations in the specifications of the equipment, the teachers areadvised to make the necessary changes, wherever needed.

    9. Teacher shall assess the performance of students continuously as per norms prescribed by MSBTE.

    10. Teacher should ensure that the respective skills and competencies are developed in the studentsafter the completion of the practical exercise.

    11. Teacher is expected to share the skills and competencies to be developed in the students.

    12. Teacher may provide additional knowledge and skills to the students even though not covered in themanual but are expected from the students by the industries.

    13. Teacher may suggest the students to refer additional related literature of the Technical papers /Reference books / Seminar proceedings, etc.

    14. During assessment teacher is expected to ask questions to the students to tap their achievementsregarding related knowledge and skills so that students can prepare while submitting record of thepracticals. Focus should be given on development of enlisted skills rather than theoretical / codifiedknowledge.

    15. Teacher should enlist the skills to be developed in the students that are expected by the industry.

    16. Teacher should organize Group discussions / brain storming sessions / Seminars to facilitate theexchange of knowledge amongst the students.

    17. Teacher should ensure that revised CIAAN - 2006 norms are followed simultaneously and progressively.

    18. Teacher should give more focus on hands on skills and should actually share the same.

    19. Teacher shall also refer to the Circular No. MSBTE/D-50/Sem (I) Lab Manual/2006/4565 dated 6/6/2006 for additional guidelines.

    v

  • 8/6/2019 Introduction 9036

    10/12

    10 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

    Object Oriented Programming

    INSTRUCTIONS FOR STUDENTS

    Students shall read the points given below for understanding the theoretical concepts and practicalapplications.

    1. Listen carefully to the lecture given by teacher about importance of subject, curriculum philosophy,

    learning structure, skills to be developed, information about equipment, instruments, procedure,method of continuous assessment, tentative plan of work in laboratory and total amount of work to bedone in a semester.

    2. Students shall undergo study visit of the laboratory for types of equipment, instruments, software tobe used, before performing experiments.

    3. Read the write up of each experiment to be performed, a day in advance.

    4. Organize the work in the group and make a record of all programs, algorithms.

    5. Understand the purpose of experiment and its practical implications.

    6. Write the answers of the questions allotted by the teacher during practical hours if possible orafterwards, but immediately.

    7. Student should not hesitate to ask any difficulty faced during conduct of practical / exercise.

    8. The student shall study all the questions given in the laboratory manual and practice to write theanswers to these questions.

    9. Student shall develop maintenance skills as expected by the industries.

    10. Student should develop the habit of pocket discussion / group discussion related to the experiments/ exercises so that exchanges of knowledge / skills could take place.

    11. Student shall attempt to develop related hands - on - skills and gain confidence.

    12. Student shall focus on development of skills rather than theoretical or codified knowledge.

    13. Student shall insist for the completion of recommended Laboratory work, industrial visits, answers tothe given questions, etc.

    14. Student shall develop the habit of evolving more ideas, innovations, skills etc. those included in thescope of the manual.

    15. Student shall refer technical magazines, proceedings of the Seminars, refer websites related to thescope of the subjects and update his knowledge and skills.

    16. Student should develop the habit of not to depend totally on teachers but to develop self learningtechniques.

    17. Student should develop the habit to react with the teacher without hesitation with respect to theacademics involved.

    18. Student should develop habit to submit the practicals, exercise continuously and progressively onthe scheduled dates and should get the assessment done.

    19. Student should be well prepared while submitting the write up of the exercise. This will develop thecontinuity of the studies and he will not be over loaded at the end of the term.

    20. For loading C++, process is same as of C. While saving give extension as .cpp.

    vi

  • 8/6/2019 Introduction 9036

    11/12

    MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION 11

    Object Oriented Programming

    Sr. Page Date of Date of Assess- Sign. of

    No. Name of the Experiments No. Perfor- submi - ment Teachermance ssion Max. and

    Marks 10 Remarks

    List of Experiments and Record of Progressive Assessment

    Note: The curriculum of the subject is studied and below is the list of experiments suggested

    1 Program to Input and Output data for 1

    finding area of rectangle

    2 Program to declare structure and create 5

    array of structure variables with sample

    of library books.

    3 Program to create an object of class 10

    taking student record as sample class.

    4 Program to create an array of object 17

    taking student as sample class.

    5 Program to access static member 23

    variables.

    6 Program to find out square of a number 28

    using friend function.

    7 Program to define class using constructor 33

    and destructor taking distance as sample

    class.8 Program for finding simple interest using 41

    constructor with default arguments.

    9 Program to overload unary and binary 46

    operators.

    10 Program to implement single and 54

    multilevel inheritance taking employee

    as sample base class.

    11 Program to implement multiple inheritance 62

    and virtual base class for calculating areaof any shape.

    12 Program to pass an entire array to the 70

    function using pointer to an array of integer

    13 Program for finding length of string using 75

    pointers to string.

    14 Program for pointer to object taking 80

    Product as sample class.

    vii

  • 8/6/2019 Introduction 9036

    12/12

    12 MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

    Object Oriented Programming

    15 Program for this pointer to access 85

    members of the current object.

    16 Program for run time polymorphism 90

    ( Virtual function ).

    17 Program for function overloading for finding 96

    area of circle and rectangle..

    18 Program for formatting output using 101

    manipulators.

    19 Program for file processing. 106

    20 Mini project 111

    Total Marks

    ...Average

    Marks out

    of 10.*

    * To be transferred to proforma of CIAAN - 2006 (Proforma A-1)

    viii