oop’s concept and its real life applications

21
OOP’S Presentation Submitted By, Sharwon Pius M. 2013/B/17

Upload: shar1

Post on 13-Jan-2017

305 views

Category:

Engineering


5 download

TRANSCRIPT

OOPS Presentation

OOPSPresentation

Submitted By,Sharwon Pius M.2013/B/17

Clearing The OOPS Concept !1. Object - Instance of Class2. Class - Blue print of Object 3. Encapsulation - Protecting our Data4. Polymorphism - Different behaviors at different instances5. Abstraction - Hiding our irrelevant Data6. Inheritance - One property of object is acquiring to another property of the object

Class & Object

we have a Class of Laptop under which Lenovo G50, HP envy and Sony viao t5 represents individual Objects. In this context each Laptop Object will have its own, Model,Year of Manufacture, Colour, Speed,BatteryPower etc.,which form Properties of the Laptop class and the associated actions i.e., object functions like Start, Restart, Volume down /up form the Methods of Laptop Class.The blueprint is the class...the Laptop is the object. The data of people using the laptop ,are data stored in the object's properties.

Abstraction & EncapsulationAbstraction says, only show relevant details and rest all hide it. For Example, This Laptop allows you to connect to wifi and surf the internet but it doesn't show you how its actually done.

Abstraction & Encapsulation works hand in hand because Abstraction says what details to be made visible & Encapsulation provides the level of access right to that visible details.SO, while connecting to the wifi the access to other laptops are restricted for security purposes.

TV REMOTE EXAMPLE4

Polymorphmism & InheritancePolymorphism can be defined as the ability of doing the same operation but with different type of input. The web cam on the Lenovo g50s is having a functionality of CameraClick(). Now same Lappie is having Butification mode available in camera, so functionality would be same but with mode. This type is said to be Static polymorphism or Compile time polymorphism.

Inheritance is the Ability to extend the functionality from base entity in new entity belonging to same group. This will help us to reuse the functionality which is defined before.

Single level inheritanceMulti-level inheritanceHierarchical inheritanceHybrid inheritance

OOPS APPLICATIONS AND PROBLEMSEngg.Numerical MethodText ProcessingSCIENCE , GUI by Case study.

The Problem statement is to make a cheap blind aid .ENGG..

import RPi.GPIO as GPIOGPIO.setwarnings(False) # supress the system worningsGPIO.cleanup() # clean up the GPIO pins i.e make the GPIO pins to lowGPIO.setmode(GPIO.BOARD) # Set the mode of numbering the pins. GPIO.setup(11, GPIO.IN)#GPIO pin 11 is the input.GPIO.setup(12, GPIO.IN)#GPIO pin 12 as inputGPIO.setup(13, GPIO.IN)#GPIO pin 13 as input pinleft = GPIO.input(11)fornt = GPIO.input(12)right = GPIO.input(13)#keep on polling for input pinswhile 1:{left = GPIO.input(11)front = GPIO.input(12)right = GPIO.input(13)if left == True or front == True or right == True:buzz(Stuck! Move your stick randomly")if left == False and front == False and right == True:buzz("move either left ot front")

elif left == False and front == True and right == False:buzz("move either left or right")elif left == False and front == True and right == True:buzz("move left")elif left == True and front == False and right == False:buzz("move either front or right")elif left == True and front == False and right == True:buzz("move front")elif left == True and front == True and right == False:buzz("move right")elif left == True and front == True and right == True:buzz("better to go back")else:buzz(" Checkup appaaratus")}

NUMERICAL MEATHODs & TEXT PROCESSINGProblem Statement: How many numbers need to be stored to save a symmetric NxN matrix in lower diagonal form? (This is our statement of problem: Note this may be a small piece of another larger problem).

Before moving forward we have to understand the intensity of this application. The Vectors and matrices as the solution itself. The 3d position of a quadcopter in know by calculation the robot pose which is described by a transformation matrix. SO BY MULTIPLYING THE LOCAL CORDINATE MATRICES WITH THE GLOBAL CORDINATE MATRICES ,WE CAN GET THE EXXACT POSITION O FTHE ROBOT.11

12

Vectors can represent state of all kinds of systems , WE can use it to represent POPULATION DISTRIBUTION , GOOGLE PAGE RANK, PASSSWORD ENCRY, FACE MORPHING, IMAGE COMPR, SEARCHING.13

Solution algorithm: In lower diagonal form, the number of values needed go as: 1x1=1, 2x2=3, 3x3=6 ... To increase the dimension of the matrix from (N-1)x(N-1) to NxN requires N new values. Therefore our algorithm is the sum of integers from 1 to N

Problem Statement: How many numbers need to be stored to save a symmetric NxN matrix in lower diagonal form?

SolutionCall the number of values we need num_elements. How do we compute this value?(a) Simplest num_elements = 1 + 2 + 3 + 4 + 5 + .... + NCoded specifically for specific values of N. Not very flexible; could be many options depending on number of values of N possible.

PROGRAM- num_elements = 0;for i = 1:N ; num_elements = num_elements + i ;end ;

15

CASE STUDYEARTH MAGNETIC FIELD REVERSAL

The earths magnetic field is improper along some regions of the surface making navigation cumbersome for voyagers and travelers.

SO Scientists prepared to study the magnetic field of earth from the 1500 hundreds itself.

They found out that each element on earth had its on magnetic spin intensity. Thus it showed the direction of the Magnetic field of earth its time period.

So they collect fallen metirots and old rocks and tested them . They ended up with bizarre results , having no correlation between them.

Finally a Prof. GARY GCATZMAR from university of California ( in 1990s)put all the data collected till date regarding this magnetic behavior of earth in a computer model . Dozens of equations describing, temp. , viscocity, diamension and so forth of the plant. Then he just let it run

To see the world 18

To see the world evolve over 100,000 years of stimulated time.

We can see that the blue region and yellow region are the main two active classes ( 1. north pole, 2. south pole) and each one of its lines are its own objects.

These objects have properties and methods give by those dozens of equations. , along with stimulated time.

This proved to state that our planets Magnetic field will reverse for every 70,000 years.

FINALE

THE GUI OF REVERSAL EARTHS MAGNETIC FIELD20

THANK YOUANY QURIES .?

To see the world 21