This document provides an introduction to object-oriented programming (OOP) concepts. It discusses problem solving using both structured programming and OOP approaches. The key concepts of OOP covered include objects, classes, methods, encapsulation, and inheritance. It also provides examples of defining a Rectangle class with attributes like length and width, and methods to calculate the area and perimeter. The document demonstrates how to create Rectangle objects, call methods on them to get the area, and use them in an application class.
AWS ML and SparkML on EMR to Build Recommendation Engine Amazon Web Services
Machine Learning
A managed supervised learning environment to build different models, including Binary Classification / Multi-class classification / Regression ML. The demos will show a dataset of banking customers with demographics, predicting the likelihood of whether they are going to default using binary classification. Second one will be predicting a UK bike rental shop traffic using linear regression, and third one for predicting a rainforest soil type using multi-class classification.
Benefits: Managed and on-demand environment for supervised learning algorithm, available as batch processing or real-time API.
Spark ML Cluster
Running spark on AWS managed cluster, storing data on HDFS / S3 persistent storage, modules include MLib and Zeppelin (Web Notebook), to build a movie recommendation engine based on “Collaborative Filtering”. The dataset contains 10M ratings provided by grouplens from MovieLens website.
Benefits: Fully managed clusters, with HA, Scalability, Elasticity and Spot instance pricing
Python Functions Tutorial | Working With Functions In Python | Python Trainin...Edureka!
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on Python Functions tutorial covers all the important aspects of functions in Python right from the introduction to what functions are, all the way till checking out the major functions and using the code-first approach to understand them better.
Agenda
Why use Functions?
What are the Functions?
Types of Python Functions
Built-in Functions in Python
User-defined Functions in Python
Python Lambda Function
Conclusion
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
AWS ML and SparkML on EMR to Build Recommendation Engine Amazon Web Services
Machine Learning
A managed supervised learning environment to build different models, including Binary Classification / Multi-class classification / Regression ML. The demos will show a dataset of banking customers with demographics, predicting the likelihood of whether they are going to default using binary classification. Second one will be predicting a UK bike rental shop traffic using linear regression, and third one for predicting a rainforest soil type using multi-class classification.
Benefits: Managed and on-demand environment for supervised learning algorithm, available as batch processing or real-time API.
Spark ML Cluster
Running spark on AWS managed cluster, storing data on HDFS / S3 persistent storage, modules include MLib and Zeppelin (Web Notebook), to build a movie recommendation engine based on “Collaborative Filtering”. The dataset contains 10M ratings provided by grouplens from MovieLens website.
Benefits: Fully managed clusters, with HA, Scalability, Elasticity and Spot instance pricing
Python Functions Tutorial | Working With Functions In Python | Python Trainin...Edureka!
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on Python Functions tutorial covers all the important aspects of functions in Python right from the introduction to what functions are, all the way till checking out the major functions and using the code-first approach to understand them better.
Agenda
Why use Functions?
What are the Functions?
Types of Python Functions
Built-in Functions in Python
User-defined Functions in Python
Python Lambda Function
Conclusion
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Looking for a computer institute to learn Full Stack development and Digital Marketing? Our institute offers comprehensive courses in both areas, providing students with the skills and knowledge needed to succeed in today's digital landscape
Tagless Final Encoding - Algebras and Interpreters and also ProgramsPhilip Schwarz
Tagless Final Encoding - Algebras and Interpreters and also Programs - An introduction, through the work of Gabriel Volpe.
Slide deck home: http://fpilluminated.com/assets/tagless-final-encoding-algebras-interpreters-and-programs.html
What is Dictionary In Python? Python Dictionary Tutorial | EdurekaEdureka!
YouTube Link: https://youtu.be/rZjhId0VkuY
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'Dictionary In Python' will help you understand the concept of dictionary, why and how we can use dictionary in python and various operations that we can perform on a dictionary. Below are the topics covered in this PPT:
What Is A Dictionary In Python?
Why Use A Python Dictionary?
Lists vs Dictionary
How To Implement A Dictionary In Python?
Operations In Python Dictionary
Use Case - Nested Dictionary
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
What's LINQ, its advantages, its Operators and examples on some of them, Methods of Writing it.
LINQ to Objects and Collections and Data Source Transformation.
A class is a code template for creating objects. Objects have member variables and have behaviour associated with them. In python a class is created by the keyword class.
An object is created using the constructor of the class. This object will then be called the instance of the class.
Std 10 Computer Chapter 3 Handling Images in HTML (Part 1)Nuzhat Memon
Std 10 Computer Chapter 3 Handling Images in HTML (Part 1) by Nuzhat Memon
Image Element
Inline and Empty Element
Attribute of Image Tag
src attribute of image tag
alt attribute of image tag
height and width attribute of image tag
align attribute of image tag
border attribute of image tag
ID attribute of image tag
lowsrc attribute of image tag
hspace and vspace attribute of image tag
Different Image File Format
Looking for a computer institute to learn Full Stack development and Digital Marketing? Our institute offers comprehensive courses in both areas, providing students with the skills and knowledge needed to succeed in today's digital landscape
Tagless Final Encoding - Algebras and Interpreters and also ProgramsPhilip Schwarz
Tagless Final Encoding - Algebras and Interpreters and also Programs - An introduction, through the work of Gabriel Volpe.
Slide deck home: http://fpilluminated.com/assets/tagless-final-encoding-algebras-interpreters-and-programs.html
What is Dictionary In Python? Python Dictionary Tutorial | EdurekaEdureka!
YouTube Link: https://youtu.be/rZjhId0VkuY
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'Dictionary In Python' will help you understand the concept of dictionary, why and how we can use dictionary in python and various operations that we can perform on a dictionary. Below are the topics covered in this PPT:
What Is A Dictionary In Python?
Why Use A Python Dictionary?
Lists vs Dictionary
How To Implement A Dictionary In Python?
Operations In Python Dictionary
Use Case - Nested Dictionary
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
What's LINQ, its advantages, its Operators and examples on some of them, Methods of Writing it.
LINQ to Objects and Collections and Data Source Transformation.
A class is a code template for creating objects. Objects have member variables and have behaviour associated with them. In python a class is created by the keyword class.
An object is created using the constructor of the class. This object will then be called the instance of the class.
Std 10 Computer Chapter 3 Handling Images in HTML (Part 1)Nuzhat Memon
Std 10 Computer Chapter 3 Handling Images in HTML (Part 1) by Nuzhat Memon
Image Element
Inline and Empty Element
Attribute of Image Tag
src attribute of image tag
alt attribute of image tag
height and width attribute of image tag
align attribute of image tag
border attribute of image tag
ID attribute of image tag
lowsrc attribute of image tag
hspace and vspace attribute of image tag
Different Image File Format
Provides an introductory level understanding of the Python Programming Language and language features. Serves as a guide for beginners and a reference to Python basics and language use cases.
This presentation forms part of a tutorial on learning Javascript foundations. It is an introduction to the basic concepts of object oriented programming and using Javascript objects to organise code.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Safalta Digital marketing institute in Noida, provide complete applications that encompass a huge range of virtual advertising and marketing additives, which includes search engine optimization, virtual communication advertising, pay-per-click on marketing, content material advertising, internet analytics, and greater. These university courses are designed for students who possess a comprehensive understanding of virtual marketing strategies and attributes.Safalta Digital Marketing Institute in Noida is a first choice for young individuals or students who are looking to start their careers in the field of digital advertising. The institute gives specialized courses designed and certification.
for beginners, providing thorough training in areas such as SEO, digital communication marketing, and PPC training in Noida. After finishing the program, students receive the certifications recognised by top different universitie, setting a strong foundation for a successful career in digital marketing.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
2. Problem Solving
The key to designing a solution is breaking it
down into manageable pieces
When writing software, we design separate
pieces that are responsible for certain parts of
the solution
3. Two popular programming design
methods:
Structured Programming (SP)
Object-Oriented Programming (OOP)
Problem Solving
4. SP
Procedural based approach
Main problem will be divided into sub-
problems
Analyze and refine each sub-problem
All sub-problem solutions are implemented as
procedures and combined to solves the main
problem
5. Object-Oriented
Programming
Object based approach
objects as foundation for problem solving
Identify objects from the main problem
An OOP program is a collection of objects
that interacts each other
6. Object-Oriented
Programming
More natural way to solve problem
Objects can be used to represent real-world
entities
For instance, an object might represent a
particular employee in a company
Each employee object handles the
processing and data management related to
that employee
7. Objects
Object-oriented programs use objects, which
represent real world objects.
A real world object is a thing, both tangible and
intangible.
An object has:
state (it has various properties, which might change)
behaviour (it can do things and can have things done
to it)
7
8. Objects
OOProgramming software objects
Software objects have state
Instance Variable/Data/Field
Software objects have behaviour
Method
8
Object’s
members
9. Objects interactions
OOP also involves interactions between
objects through calling (invoking) of
methods.
9
Method CallsThe OilSensor object calls the warning() method
of the Controller, which then invokes the OilLight
TurnOn() method.
10. Method can Return Values
Return value: A result that the method has
computed and returns it to the caller
Can returns 0 or 1 value
Scanner s = new Scanner(System.in);
int num = s.nextInt();
10
Continued…
11. Classes and Objects
To create an object , we MUST provide a
definition/description for it
A class is a description/blue print of a kind of
object
It does not by itself create any objects
How to create an object ?
An object is called an instance of a class
Object instantiation – process of creating an object
11
13. Creating Objects
A variable holds either a primitive type or a
reference to an object
A class name can be used as a type to declare an
object reference variable
String name;
No object is created with this declaration
An object reference variable holds the address of
an object
The object itself must be created separately
13
14. Creating Objects
Generally, we use the new operator to create
an object
14
name = new String (“Ali bin Ahmad");
This calls the String constructor, which is
a special method that sets up the object
• Creating an object is called instantiation
• An object is an instance of a particular class
15. Constructing String
objects
Strings stringRef = new String(stringLiteral);
eg.
String name = new String(“Muhammad Haziq”);
Since strings are used frequently, Java provides a
shorthand notation for creating a string:
String name = "Muhammad Haziq”;
15
16. Constructing String objects
New String objects are created whenever the
String constructors are used:
16
String name4 = new String(); // Creates an object
String name5 = new String("Socrates");
String name6 = name4;
17. Invoking Methods
We've seen that once an object has been instantiated, we
can use the dot operator to invoke its methods
name.length()
A method may return a value, which can be used in an
assignment or expression
count = name.length();
S.o.p(“Num. of char in “ + name+ “=“ + count);
A method invocation can be thought of as asking an object
to perform a service
17
18. Object without object reference
cannot be accessed
18
String n1 = new String(“Ali“);
new String(“Abu“);
sv1: String
: String
value = “Ali”
value = “Abu”
n1
n1- object reference variable
20. References
Note that a primitive variable contains the value
itself, but an object variable contains the address
of the object
An object reference can be thought of as a pointer
to the location of the object
Rather than dealing with arbitrary addresses, we
often depict a reference graphically
20
"Steve Jobs"name1
num1 38
21. Assignment Revisited
The act of assignment takes a copy of a value
and stores it in a variable
For primitive types:
21
num1 38
num2 96
Before:
num2 = num1;
num1 38
num2 38
After:
23. Questions
23
String stud1 = new String(“Ani”);
int studID = 65000;
What does variable stud1 contains?
What does variable studID contains?
Is this allowed? stud1 = studID;
String stud1;
stud1 = new String(“Ani”);
stud1 = new String(“Obi”);
How many objects were created by the program?
How many reference variables does the program contain?
24. Writing Classes
The programs we’ve written in previous
examples have used classes defined in the Java
standard class library
Now we will begin to design programs that rely
on classes that we write ourselves
True object-oriented programming is based on
defining classes that represent objects with
well-defined characteristics and functionality
24
25. Graphical Representation of a
Class
25
The notation we used here is based on the industry standard notation
called UML, which stands for Unified Modeling Language.
A UML Class Diagram
Class Name
Variables
Method
Type of data
Access
Type of
return
value
A class can
contain data
declarations and
method
declarations
27. Object Design Questions
What role will the object perform?
What data or information will it need?
Look for nouns.
Which actions will it take?
Look for verbs.
What interface will it present to other objects?
These are public methods.
What information will it hide from other objects?
These are private.
27
28. Design Specification for a
Rectangle
Class Name: Rectangle
Role: To represent a geometric rectangle
States (Information or instance variables)
- Length: A variable to store rectangle’s length
(private)
- Width: A variable to store rectangle's width (private)
Behaviors (public methods)
- Rectangle(): A constructor method to set a rectangle’s
length and width
- calculateArea(): A method to calculate a rectangle’s
area
28
29. UML Design Specification
29
UML Class Diagram
Class Name
What data does it need?
What behaviors
will it perform?
Public
methods
Hidden
information
Instance variables -- memory locations
used for storing the information needed.
Methods -- blocks of code used to
perform a specific task.
30. Method can has input (parameter) &
output (return value)
Parameter : value given to method so that it can
do its task
Can has 0 or more parameter
Return value: A result that the method has
computed and returns it to the caller
Can returns 0 or 1 value
Eg. - pow(2,3)
- calculateArea()
- getBalance( )
- move( )
30
Continued…
31. Method Declarations
A method declaration specifies the code that will
be executed when the method is invoked (called)
When a method is invoked, the flow of control
jumps to the method and executes its code
When complete, the flow returns to the place
where the method was called and continues
The invocation may or may not return a value,
depending on how the method is defined
31
32. Method Control Flow
If the called method is in the same class, only
the method name is needed
32
myMethod();
myMethodcompute
33. Method Control Flow
The called method is often part of another
class or object
33
doIt helpMe
helpMe();obj.doIt();
main
34. Method Design
What specific task will the method perform?
What input data will it need to perform its
task?
What result will the method produce?
How input data are processed into result?
What algorithm will the method use?
34
35. Method calculateArea()
Algorithm
Method Name: calculateArea()
Task: To calculate the area of a rectangle
Data Needed (variables)
length: A variable to store the rectangle's length
width: A variable to store the rectangle's width
area: A variable to store result of calculation
Processing: area = length x width
Result to be returned: area
35
36. Coding into Java
36
public class Rectangle // Class header
{
private double length; // Instance variables
private double width;
public Rectangle(double l, double w) // Constructor method
{
length = l;
width = w;
}
public double calculateArea() // calculate area method
{
double area;
area = length * width;
return area;
} // calculateArea()
} // Rectangle class
40. Creating Rectangle Instances
Create, or instantiate, two instances of the
Rectangle class:
40
The objects (instances)
store actual values.
Rectangle rectangle1 = new Rectangle(30,10);
Rectangle rectangle2 = new Rectangle(25, 20);
41. Using Rectangle Instances
We use a method call to ask each object to tell
us its area:
41
rectangle1 area 300
rectangle2 area 500Printed output:
System.out.println("rectangle1 area " + rectangle1.calculateArea());
System.out.println("rectangle2 area " + rectangle2.calculateArea());
References to
objects
Method calls
42. Syntax : Object Construction
new ClassName(parameters);
Example:
new Rectangle(30, 20);
new Car("BMW 540ti", 2004);
Purpose:
To construct a new object, initialize it with the
construction parameters, and return a
reference to the constructed object.
42
43. The RectangleUser Class
Definition
public class RectangleUser
{
public static void main(String argv[])
{
Rectangle rectangle1 = new Rectangle(30,10);
Rectangle rectangle2 = new Rectangle(25,20);
System.out.println("rectangle1 area " +
rectangle1.calculateArea());
System.out.println("rectangle2 area " +
rectangle2.calculateArea());
} // main()
} // RectangleUser
43
An application must
have a main() method
Object
Use
Object
Creation
Class
Definition