Object Oriented Programming: Code Snippets and Implementation Examples - Prof. Maharjan, Assignments of Object Oriented Programming

Object Oriented Programming Final Assignment

Typology: Assignments

2017/2018

Uploaded on 04/29/2023

manish_mahaseth
manish_mahaseth 🇳🇵

9 documents

1 / 146

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Object Oriented
Programming
Niraj Yadav
1/14/18
OOP
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Object Oriented Programming: Code Snippets and Implementation Examples - Prof. Maharjan and more Assignments Object Oriented Programming in PDF only on Docsity!

Object Oriented

Programming

Niraj Yadav 1/14/18 OOP

Table of Contents

  • Task
  • [1.1, M1] I. Discuss the principles, characteristics and features of objected oriented programming.
  • Object Oriented Programming
  • Class
  • Objects
  • Data Abstraction
  • Encapsulation
  • Constructer
  • Destructor
  • Static Members............................................................................................................................
  • Inheritance
  • Inheritance: Base and Derived Classes
  • Initializing Base Class
  • Types of Inheritance
  • Single Inheritance
  • Multiple Inheritance
  • Multilevel Inheritance
  • Hierarchical Inheritance
  • Hybrid Inheritance
  • Polymorphism
  • Static Polymorphism
  • Function Overloading......................................................................................................................
  • Operator Overloading
  • Dynamic Polymorphism
  • Abstract Classes
  • Virtual Functions
  • Task
  • based on above scenario. [2.1].................................................................................................... I. Identify the objects and data and file structures required to implement a given design
  • Conclusion
  • Task 2.2
  • Introduction
  • Various diagram showing design of the application
  • Data Dictionary of Database Employee Information System
  • 2.2 GUI Design Considerations:
    1. Login Form...........................................................................................................................
    1. Main Form Design [Administrator Interface]
    1. User Management Form
    1. Department Management Form.........................................................................................
    1. Manage Employee Form
    1. Search Employee Record Form..........................................................................................
    1. Class Diagram
    1. Conclusion
  • Task
  • Introduction
    1. Implementation of Database designed in Task2.2
    1. Implementation of the Employee Information System in task 2.2.
  • Implementation Architecture [3-Tier Architecture]
  • Implementation of all Classes of EISDataAccessLayer.
  • 2.1 ClassDatabaseConnection
  • 2.2. ClassRole...............................................................................................................................
  • 2.3. ClassUser
  • 2.4. ClassDepartment
  • Implementation of all Classes of EISBusinessLogicLayer
  • Implementation of all Forms of EIS Application
  • 2.7 App.config
  • 2.8. FormLogin
  • 2.9. FormMainAdministrator
  • 2.10. FormRole
  • 2.11. FormUser
  • 2.12. FormDepartment
  • 2.13.FormManageEmployee
  • 2.14. FormSearchEmployee
  • 2.15. Program.cs
  • 2.16. Conclusion
  • Task
  • Task 4I........................................................................................................................................
  • Test case 2: Functionality Testing against Requirements
    1. Testing the Role base User Authentication
  • Fig: Login Form
  • Fig: Main Form
  • Fig: Login Form
    1. Testing of Insert, Update, Delete and Retrieval of data in Role Management Section
  • Fig: User Role Form
  • Fig: User Role
  • Fig: User Administration Form
  • Section. 3. Testing of Insert, Update, Delete and Retrieval of data in Department Management
  • Section 4. Testing of Insert, Update, Delete and Retrieval of data in Employee Management
    1. Testing of Search functionality of Employee Section
  • Conclusion
  • Task 4II
  • Introduction
  • Conclusion
  • Task 4III
  • Introduction
  • Implementation of Onscreen Help
  • Using On Screen Help Menu
  • Task 4 IV....................................................................................................................................
  • Introduction
  • Documentation for Design and Development of Employee Information System.
  • Abstract
  • Introduction:
  • Modules:.....................................................................................................................................
  • Overall System Design
  • Database Design
  • Data Dictionary of Database Employee Information System
  • Implementation Architecture
  • Software Functionality testing
  • Test case 2: Functionality Testing against Requirements
    1. Testing the Role base User Authentication
    1. Testing of Insert, Update, Delete and Retrieval of data in Role Management Section
  • Section. 3. Testing of Insert, Update, Delete and Retrieval of data in Department Management
  • Section 4. Testing of Insert, Update, Delete and Retrieval of data in Employee Management
    1. Testing of Search functionality of Employee Section
  • Conclusion
  • Reference:

Object Oriented Programming Object-oriented programming (OOP) is the most recent concept in computer programming approach. OOP allows decomposition of program into a number of entities called objects and then builds data and functions around these objects. However, the function of one object can access the functions of another object. As the OOP is the modern programming language it has some principal and characteristics which are discussed below: Class Object is the basic element of OOP approach which is declared by using class. Class is a collection of objects of similar type. For example, mango, apple and orange are the members of the class fruits. Classes are user defined data types and behave like the built in data types of the programming languages. Classes are also known as abstract data types (ADT) in OOP because they use the concept of data abstraction. Objects Object is the basic run time entities in an object oriented program which consists of data and functions. It may also represent user defined data. Programming problem is analyzed in terms of objects. The program objects are similar to the real world objects. Hence, object is a variable consisting both routine and data that is treated as discrete entity within programming. Data Abstraction Data Abstraction is the lessening of a specific assortment of information to a rearranged representation of the entirety. Abstraction, by and large, is the procedure of taking without end or expelling qualities from something keeping in mind the end goal to diminish it to an arrangement of crucial attributes.

Encapsulation Encapsulation is striking part features of OOP approach. The wrapping up of data and function into a single unit called class is known as encapsulation. The data is not accessible to the outside world and only those functions which are wrapped in the class can access the data. This feature of OOP approach prevents the data from the accidental or unnecessary modifications. The functions of the object provide the interface between the object data and program. The code that defines encapsulation is shown below:

Constructer A "constructor" is an extraordinary part work whose endeavor is to actually present of an object of its class. It is excellent in light of the fact that its name is the same name of the same as the class name. It is called constructor since it fabricates the assessed estimations of the information individuals from the class. Rules to write constructer are given below:

  • Constructor proclaimed with no arrival sort.
  • It ought to have open or ensured access inside the class.
  • They are summoned naturally when the articles are made.
  • They can't be acquired; however a determined class can call the base constructors.
  • Constructors can't be virtual, can't allude to their locations.
  • An item with a constructor (or destructor) can't be utilized as an individual from a union.

Destructor "Destructor" capacities are the opposite of constructor capacities. They are called when articles are crushed (deallocated). Assign a function as a class' destructor by going before the class name with a tilde (~).Rules to write destructor functions are:

  • A destructor function name is the same as that of the class it has a place with the exception of that the first character of the name must be tilde (~).
  • It is proclaimed with no arrival sorts (not by any means void) since it can't ever give back a quality..
  • It takes no contentions and consequently can't be over-burden.
  • Destructor ought to be free in the class assertion. Static Members Static variables A field declared with the static modifier is called a static variable. A static variable comes into existence before execution of the static constructor Public static class Temperature Converter { Public static double } Static Methods These are called with the type name. No instance is required—this makes them slightly faster. Static methods can be public or private. { static void Method A() { Console.WriteLine( " Static method " );

Types of Inheritance Single Inheritance Single Inheritance a typical type of inheritance, in which classes have one base class. The base class from which every class is inferred is pronounced before the presentation of the determined class. It is not adequate to give a forward-referencing statement to a base class; it must be a finished revelation. The program and Output is given below: