SlideShare a Scribd company logo
Programming 101
The composition of sequences of instructions
What is Programming?
The process of preparing an instructional program for device
Programming is a technological process that tells a computer which
tasks to perform to solve problems.
Why Programming is
important?
Programming is important because it enables us to create software, websites,
mobile apps, games, and many other digital products that we use in our daily
lives. It allows us to automate tasks, solve complex problems, and create
innovative solutions that improve our lives and businesses. In today's digital
age, programming skills are in high demand and are essential for success in
many industries, from tech to finance to healthcare. By learning to code, we
can open up a world of opportunities and take advantage of the many benefits
that technology has to offer.
back to the early 19th century when mathematician Ada Lovelace
created an algorithm for Charles Babbage's Analytical Engine, which is
considered the first computer. However, the first actual programming
language was developed in the 1950s, called FORTRAN (Formula
Translation). This language was used for scientific and engineering
calculations.
History of Programming
In the 1960s, programming languages such as COBOL (Common
Business-Oriented Language), BASIC (Beginners All-Purpose Symbolic
Instruction Code), and ALGOL (Algorithmic Language) were developed.
These languages were used to write applications for business and
research.
History of Programming
In the 1960s, programming languages such as COBOL (Common
Business-Oriented Language), BASIC (Beginners All-Purpose Symbolic
Instruction Code), and ALGOL (Algorithmic Language) were developed.
These languages were used to write applications for business and
research.
The 1970s saw the development of languages such as C and Pascal,
which were used to write operating systems and applications. In the
1980s, the first object-oriented language, Smalltalk, was created. This
language allowed developers to create reusable code and was used for
graphical user interfaces.
The 1990s saw the development of scripting languages such as Perl
and Python, which were used for web development. In the early
2000s, languages such as Ruby and PHP became popular for web
development. Today, programming languages such as Java, C++,
Python, and JavaScript are widely used for various applications.
History of Programming
Programming requires logical thinking and the ability to break down
complex problems into smaller, more manageable parts.
Programmers use logic to develop algorithms, which are step-by-step
procedures for solving problems. These algorithms must be logical
and accurate, with each step leading logically to the next.
In programming, logical operators and conditional statements are
used to control the flow of a program. Logical operators such as AND,
OR, and NOT are used to evaluate logical expressions and make
decisions based on the results. Conditional statements such as IF,
ELSE, and SWITCH are used to execute different parts of a program
based on specific conditions.
Thus, logic is a critical component of
programming. Without it, programs would not
work correctly or produce the desired results.
By developing strong logical thinking skills,
programmers can write efficient and effective
code that solves complex problems and meets
the needs of users.
Types of Programming Languages
Programming languages can be broadly classified
into three categories:
Low-Level Languages: These languages are closer to the machine language
and are used to write operating systems, device drivers, and firmware.
Examples include Assembly Language, C, and C++.
1.
High-Level Languages: These languages are easier to learn and use than
low-level languages. They are used to write applications, games, and
websites. Examples include Java, Python, Php, and Ruby.
2.
Scripting Languages: These languages are used to automate repetitive
tasks, such as web development and system administration. Examples
include Perl, Python, and Ruby.
3.
Machine Language: Machine language is
the lowest-level programming language
that a computer can understand. It is a
binary code consisting of 0's and 1's that
correspond to machine instructions. Each
computer architecture has its specific
machine language, which is difficult to
read and write.
Low Level Programming Language
Assembly Language: Assembly
language is a low-level programming
language that is easier to read and
write than machine language.
Assembly language uses mnemonics
to represent machine instructions,
making it more human-readable.
Assembly language programs are
translated into machine language by
an assembler.
Low Level Programming Language
C: C is a high-level programming
language that can also be considered a
low-level language due to its low-level
memory access and pointer
manipulation capabilities. C provides
direct access to hardware, making it an
ideal choice for systems programming
and embedded systems development.
Low Level Programming Language
FORTRAN: FORTRAN (FORmula TRANslation)
is a high-level programming language that
was designed for scientific and engineering
applications. FORTRAN provides low-level
control over hardware, allowing for efficient
computation and numerical analysis.
Low Level Programming Language
High Level Programming Language
Java: Java is a high-level, object-oriented programming
language developed by Sun Microsystems (now owned
by Oracle Corporation). Java is designed to be platform-
independent, meaning that Java code can run on any
computer with a Java Virtual Machine (JVM) installed.
Java is widely used for developing web applications,
mobile apps, and enterprise software.
High Level Programming Language
Python: Python is a high-level, interpreted programming
language that emphasizes code readability and
simplicity. Python is widely used for scientific
computing, data analysis, web development, and
artificial intelligence.
High Level Programming Language
C++: C++ is an extension of the C programming language
that adds support for object-oriented programming. C++
is widely used for developing high-performance
software, including operating systems, games, and
scientific simulations.
High Level Programming Language
JavaScript: JavaScript is a high-level, interpreted
programming language that is widely used for
developing web applications. JavaScript runs in web
browsers and provides interactivity and dynamic
behavior to web pages.
High Level Programming Language
Ruby: Ruby is a high-level, interpreted programming
language that emphasizes simplicity and productivity.
Ruby is widely used for web development, automation,
and scripting.
High Level Programming Language
Swift: Swift is a high-level, compiled programming
language developed by Apple Inc. Swift is designed for
developing applications for iOS, macOS, and watchOS.
Swift is known for its safety, speed, and expressiveness.
High Level Programming Language
PHP: PHP is a server-side, interpreted programming
language that is widely used for developing web
applications. PHP is known for its simplicity and ease of
use, making it a popular choice for web developers.
High Level Programming Language
SQL: SQL (Structured Query Language) is a domain-
specific language used for managing relational
databases. SQL is used to create, modify, and query
databases, and is widely used in business and data
analysis.
COMPUTER HARDWARE
HIGH LEVEL
LOW LEVEL
OBJECT ORIENTED
PROCEDURAL
ASSEMBLY LANGUAGE
MACHINE LANGUAGE
Intro to programming and intro to java netbean.pdf
OBJECT ORIENTED
PROGRAMMING
(OOP)
computer programming model
that organizes software design
around data, or objects, rather
than functions and logic. An
object can be defined as a data
field that has unique attributes
and behavior.
Procedural programming is about writing procedures or methods that
perform operations on the data, while object-oriented programming is
about creating objects that contain both data and methods.
Object-oriented programming has several advantages over
procedural programming:
OOP is faster and easier to execute
OOP provides a clear structure for the programs
OOP helps to keep the Java code DRY "Don't Repeat Yourself",
and makes the code easier to maintain, modify and debug
OOP makes it possible to create full reusable applications with
less code and shorter development time
What is the structure of object-oriented programming?
Classes are user-defined data types that
act as the blueprint for individual objects,
attributes and methods.
What is the structure of object-oriented programming?
Objects are instances of a class created
with specifically defined data. Objects can
correspond to real-world objects or an
abstract entity. When class is defined
initially, the description is the only object
that is defined.
What is the structure of object-oriented programming?
Methods are functions that objects can
perform. They are defined inside a class
that describe the behaviors of an object.
Each method contained in class definitions
starts with a reference to an instance
object. Additionally, the subroutines
contained in an object are called instance
methods. Programmers use methods for
reusability or keeping functionality
encapsulated inside one object at a time.
What is the structure of object-oriented programming?
Attributes represent the state of an object.
In other words, they are the characteristics
that distinguish classes. Objects have data
stored in the attributes field. Class
attributes belong to the class itself and are
defined in the class template.
Intro to programming and intro to java netbean.pdf
The main principles of OOP
The encapsulation principle states that all important information is
contained inside an object and only select information is exposed. The
implementation and state of each object are privately held inside a defined
class. Other objects do not have access to this class or the authority to
make changes. They are only able to call a list of public functions or
methods. This characteristic of data hiding provides greater program
security and avoids unintended data corruption.
Encapsuation
The main principles of OOP
Objects only reveal internal mechanisms that are relevant for the use of
other objects, hiding any unnecessary implementation code. The derived
class can have its functionality extended. This concept can help developers
more easily make additional changes or additions over time.
Abstraction
The main principles of OOP
Classes can reuse code and properties from other classes. Relationships
and subclasses between objects can be assigned, enabling developers to
reuse common logic, while still maintaining a unique hierarchy. Inheritance
forces more thorough data analysis, reduces development time and
ensures a higher level of accuracy.
Inheritance
The main principles of OOP
Objects are designed to share behaviors, and they can take on more than
one form. The program determines which meaning or usage is necessary for
each execution of that object from a parent class, reducing the need to
duplicate code. A child class is then created, which extends the
functionality of the parent class. Polymorphism enables different types of
objects to pass through the same interface
Polymorphism
Programming in Java
Download and Install
Apache Netbeans IDE
netbeans.apache.org/front/main/download/
www.oracle.com/java/technologies/downloads/?er=221886
Java Development Kit
Every line of code that runs in Java must be inside a class. In our
example, we named the class Main. A class should always start
with an uppercase first letter.
Note: Java is case-sensitive: "MyClass" and "myclass"
has different meaning.
System.out.println()
println() method to print a line of text to the screen:
Java Syntax
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
Java Variables
String - stores text, such as "Hello". String values are surrounded by
double quotes
int - stores integers (whole numbers), without decimals, such as 123
or -123
float - stores floating point numbers, with decimals, such as 19.99
or -19.99
char - stores single characters, such as 'a' or 'B'. Char values are
surrounded by single quotes
boolean - stores values with two states: true or false
OPERATOR NAME DESCRIPTION EXAMPLE
+ Addition Adds together two values x + y
- Subtraction Subtracts one value from another x - y
* Multiplication Multiplies two values x * y
/ Division Divides one value by another x / y
% Modulus Returns the division remainder x % y
Arithmetic Operations
ARITHMETIC OPERATORS ARE USED TO PERFORM COMMON MATHEMATICAL OPERATIONS.
Java supports the usual logical conditions from
mathematics:
Less than: a < b
Less than or equal to: a <= b
Greater than: a > b
Greater than or equal to: a >= b
Equal to a == b
Not Equal to: a != b
Conditional Statements:
Use if to specify a block of code to be executed, if a specified
condition is true
Use else to specify a block of code to be executed, if the same
condition is false
Use else if to specify a new condition to test, if the first
condition is false
Use switch to specify many alternative blocks of code to be
executed
Conditions
and
If Statements
if (condition) {
//block of code to be executed if
condition is true
}
Write a Java program to divide two numbers and print them on the screen.
Test Data :
50/3
Expected Output :
16
Write a Java program to print the results of the following operations.
Test Data:
a. -5 + 8 * 6
b. (55+9) % 9
c. 20 + -3*5 / 8
d. 5 + 15 / 3 * 2 - 8 % 3
Expected Output :
43
1
19
13
Write a Java program to print the sum of two numbers.
Test Data:
74 + 36
Expected Output :
110
Excercises
Write a Java program that takes two numbers as input and displays the product of two
numbers.
Test Data:
Input first number: 25
Input second number: 5
Expected Output :
25 x 5 = 125
Write a Java program to print the sum (addition), multiply, subtract, divide and
remainder of two numbers.
Test Data:
Input first number: 125
Input second number: 24
Expected Output :
125 + 24 = 149
125 - 24 = 101
125 x 24 = 3000
125 / 24 = 5
125 mod 24 = 5
Excercises
Write a Java program that compute the average of 3 number
Test Data :
80, 81, and 90
Expected Output :
The average of 80, 81, and 90 is 83.66
Write a Java program to print the results of Fahrenheit convert to celsius
Test Data:
120
Expected Output :
48.88
use this formula: (°F − 32) × 5/9 = °C
Write a Java program to print the area of rectangle
Test Data:
Lenght = 40 and Width = 70
Expected Output :
The area of L:40 and W:70 is 2800
Excercises

More Related Content

Similar to Intro to programming and intro to java netbean.pdf (20)

La5 ict-topic-5-programming
La5 ict-topic-5-programmingLa5 ict-topic-5-programming
La5 ict-topic-5-programming
Kak Yong
 
computer programming computer programmin
computer programming computer programmincomputer programming computer programmin
computer programming computer programmin
Jifarnecho
 
Introduction to Programming kkkkkkkkkkkkk
Introduction to Programming kkkkkkkkkkkkkIntroduction to Programming kkkkkkkkkkkkk
Introduction to Programming kkkkkkkkkkkkk
kimtrm34
 
RK_Presentation_Science_current technology.pptx
RK_Presentation_Science_current technology.pptxRK_Presentation_Science_current technology.pptx
RK_Presentation_Science_current technology.pptx
koodalcsc
 
Presentation_Science_about current scenario.pptx
Presentation_Science_about current scenario.pptxPresentation_Science_about current scenario.pptx
Presentation_Science_about current scenario.pptx
koodalcsc
 
Define Computer language, Translator, Standard input out C
Define Computer language, Translator, Standard input out CDefine Computer language, Translator, Standard input out C
Define Computer language, Translator, Standard input out C
Dr Shailendra Bhalawe
 
Programming language
Programming languageProgramming language
Programming language
MalayKalavadia
 
Code learning
Code learningCode learning
Code learning
Vikas kumar
 
Programming Lecture 01 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Programming Lecture 01 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqProgramming Lecture 01 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Programming Lecture 01 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
ZainabNoor83
 
Form5 cd1
Form5 cd1Form5 cd1
Form5 cd1
smktsj2
 
Python Programming-Skill Course - unit-i.pptx
Python Programming-Skill Course - unit-i.pptxPython Programming-Skill Course - unit-i.pptx
Python Programming-Skill Course - unit-i.pptx
KavithaDonepudi
 
Advanced Programming practices - UNIT 1 .pptx
Advanced Programming practices - UNIT 1 .pptxAdvanced Programming practices - UNIT 1 .pptx
Advanced Programming practices - UNIT 1 .pptx
rasheedabegum11
 
Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptx
crAmth
 
Presentation-1.pptx
Presentation-1.pptxPresentation-1.pptx
Presentation-1.pptx
animewatcher7
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
Hajar Len
 
Introduction-to-Programming-Languages.pptx
Introduction-to-Programming-Languages.pptxIntroduction-to-Programming-Languages.pptx
Introduction-to-Programming-Languages.pptx
ranjan317165
 
Lecture 10 software development
Lecture 10 software developmentLecture 10 software development
Lecture 10 software development
Jehanzaib Yousuf
 
Introduction to computer and its fundamentals.pptx
Introduction to computer and its fundamentals.pptxIntroduction to computer and its fundamentals.pptx
Introduction to computer and its fundamentals.pptx
Guna Dhondwad
 
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.docICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
AmanGunner
 
Programming Part 01
Programming Part 01Programming Part 01
Programming Part 01
zakri zakaria
 
La5 ict-topic-5-programming
La5 ict-topic-5-programmingLa5 ict-topic-5-programming
La5 ict-topic-5-programming
Kak Yong
 
computer programming computer programmin
computer programming computer programmincomputer programming computer programmin
computer programming computer programmin
Jifarnecho
 
Introduction to Programming kkkkkkkkkkkkk
Introduction to Programming kkkkkkkkkkkkkIntroduction to Programming kkkkkkkkkkkkk
Introduction to Programming kkkkkkkkkkkkk
kimtrm34
 
RK_Presentation_Science_current technology.pptx
RK_Presentation_Science_current technology.pptxRK_Presentation_Science_current technology.pptx
RK_Presentation_Science_current technology.pptx
koodalcsc
 
Presentation_Science_about current scenario.pptx
Presentation_Science_about current scenario.pptxPresentation_Science_about current scenario.pptx
Presentation_Science_about current scenario.pptx
koodalcsc
 
Define Computer language, Translator, Standard input out C
Define Computer language, Translator, Standard input out CDefine Computer language, Translator, Standard input out C
Define Computer language, Translator, Standard input out C
Dr Shailendra Bhalawe
 
Programming Lecture 01 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Programming Lecture 01 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqProgramming Lecture 01 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
Programming Lecture 01 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
ZainabNoor83
 
Form5 cd1
Form5 cd1Form5 cd1
Form5 cd1
smktsj2
 
Python Programming-Skill Course - unit-i.pptx
Python Programming-Skill Course - unit-i.pptxPython Programming-Skill Course - unit-i.pptx
Python Programming-Skill Course - unit-i.pptx
KavithaDonepudi
 
Advanced Programming practices - UNIT 1 .pptx
Advanced Programming practices - UNIT 1 .pptxAdvanced Programming practices - UNIT 1 .pptx
Advanced Programming practices - UNIT 1 .pptx
rasheedabegum11
 
Python-unit -I.pptx
Python-unit -I.pptxPython-unit -I.pptx
Python-unit -I.pptx
crAmth
 
Introduction-to-Programming-Languages.pptx
Introduction-to-Programming-Languages.pptxIntroduction-to-Programming-Languages.pptx
Introduction-to-Programming-Languages.pptx
ranjan317165
 
Lecture 10 software development
Lecture 10 software developmentLecture 10 software development
Lecture 10 software development
Jehanzaib Yousuf
 
Introduction to computer and its fundamentals.pptx
Introduction to computer and its fundamentals.pptxIntroduction to computer and its fundamentals.pptx
Introduction to computer and its fundamentals.pptx
Guna Dhondwad
 
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.docICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
AmanGunner
 

Recently uploaded (20)

6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdfHow Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
Rejig Digital
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
Jira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : IntroductionJira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : Introduction
Ravi Teja
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptxISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
AyilurRamnath1
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Data Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any ApplicationData Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any Application
Safe Software
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
LSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection FunctionLSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection Function
Takahiro Harada
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy SurveyTrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
6th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 20256th Power Grid Model Meetup - 21 May 2025
6th Power Grid Model Meetup - 21 May 2025
DanBrown980551
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training RoadblocksDown the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdfHow Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
How Advanced Environmental Detection Is Revolutionizing Oil & Gas Safety.pdf
Rejig Digital
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
Jira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : IntroductionJira Administration Training – Day 1 : Introduction
Jira Administration Training – Day 1 : Introduction
Ravi Teja
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptxISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
ISOIEC 42005 Revolutionalises AI Impact Assessment.pptx
AyilurRamnath1
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Data Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any ApplicationData Virtualization: Bringing the Power of FME to Any Application
Data Virtualization: Bringing the Power of FME to Any Application
Safe Software
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
LSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection FunctionLSNIF: Locally-Subdivided Neural Intersection Function
LSNIF: Locally-Subdivided Neural Intersection Function
Takahiro Harada
 
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Scaling GenAI Inference From Prototype to Production: Real-World Lessons in S...
Anish Kumar
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy SurveyTrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
Ad

Intro to programming and intro to java netbean.pdf

  • 2. The composition of sequences of instructions What is Programming? The process of preparing an instructional program for device Programming is a technological process that tells a computer which tasks to perform to solve problems.
  • 4. Programming is important because it enables us to create software, websites, mobile apps, games, and many other digital products that we use in our daily lives. It allows us to automate tasks, solve complex problems, and create innovative solutions that improve our lives and businesses. In today's digital age, programming skills are in high demand and are essential for success in many industries, from tech to finance to healthcare. By learning to code, we can open up a world of opportunities and take advantage of the many benefits that technology has to offer.
  • 5. back to the early 19th century when mathematician Ada Lovelace created an algorithm for Charles Babbage's Analytical Engine, which is considered the first computer. However, the first actual programming language was developed in the 1950s, called FORTRAN (Formula Translation). This language was used for scientific and engineering calculations. History of Programming In the 1960s, programming languages such as COBOL (Common Business-Oriented Language), BASIC (Beginners All-Purpose Symbolic Instruction Code), and ALGOL (Algorithmic Language) were developed. These languages were used to write applications for business and research.
  • 6. History of Programming In the 1960s, programming languages such as COBOL (Common Business-Oriented Language), BASIC (Beginners All-Purpose Symbolic Instruction Code), and ALGOL (Algorithmic Language) were developed. These languages were used to write applications for business and research. The 1970s saw the development of languages such as C and Pascal, which were used to write operating systems and applications. In the 1980s, the first object-oriented language, Smalltalk, was created. This language allowed developers to create reusable code and was used for graphical user interfaces.
  • 7. The 1990s saw the development of scripting languages such as Perl and Python, which were used for web development. In the early 2000s, languages such as Ruby and PHP became popular for web development. Today, programming languages such as Java, C++, Python, and JavaScript are widely used for various applications. History of Programming
  • 8. Programming requires logical thinking and the ability to break down complex problems into smaller, more manageable parts. Programmers use logic to develop algorithms, which are step-by-step procedures for solving problems. These algorithms must be logical and accurate, with each step leading logically to the next. In programming, logical operators and conditional statements are used to control the flow of a program. Logical operators such as AND, OR, and NOT are used to evaluate logical expressions and make decisions based on the results. Conditional statements such as IF, ELSE, and SWITCH are used to execute different parts of a program based on specific conditions.
  • 9. Thus, logic is a critical component of programming. Without it, programs would not work correctly or produce the desired results. By developing strong logical thinking skills, programmers can write efficient and effective code that solves complex problems and meets the needs of users.
  • 10. Types of Programming Languages
  • 11. Programming languages can be broadly classified into three categories: Low-Level Languages: These languages are closer to the machine language and are used to write operating systems, device drivers, and firmware. Examples include Assembly Language, C, and C++. 1. High-Level Languages: These languages are easier to learn and use than low-level languages. They are used to write applications, games, and websites. Examples include Java, Python, Php, and Ruby. 2. Scripting Languages: These languages are used to automate repetitive tasks, such as web development and system administration. Examples include Perl, Python, and Ruby. 3.
  • 12. Machine Language: Machine language is the lowest-level programming language that a computer can understand. It is a binary code consisting of 0's and 1's that correspond to machine instructions. Each computer architecture has its specific machine language, which is difficult to read and write. Low Level Programming Language
  • 13. Assembly Language: Assembly language is a low-level programming language that is easier to read and write than machine language. Assembly language uses mnemonics to represent machine instructions, making it more human-readable. Assembly language programs are translated into machine language by an assembler. Low Level Programming Language
  • 14. C: C is a high-level programming language that can also be considered a low-level language due to its low-level memory access and pointer manipulation capabilities. C provides direct access to hardware, making it an ideal choice for systems programming and embedded systems development. Low Level Programming Language
  • 15. FORTRAN: FORTRAN (FORmula TRANslation) is a high-level programming language that was designed for scientific and engineering applications. FORTRAN provides low-level control over hardware, allowing for efficient computation and numerical analysis. Low Level Programming Language
  • 16. High Level Programming Language Java: Java is a high-level, object-oriented programming language developed by Sun Microsystems (now owned by Oracle Corporation). Java is designed to be platform- independent, meaning that Java code can run on any computer with a Java Virtual Machine (JVM) installed. Java is widely used for developing web applications, mobile apps, and enterprise software.
  • 17. High Level Programming Language Python: Python is a high-level, interpreted programming language that emphasizes code readability and simplicity. Python is widely used for scientific computing, data analysis, web development, and artificial intelligence.
  • 18. High Level Programming Language C++: C++ is an extension of the C programming language that adds support for object-oriented programming. C++ is widely used for developing high-performance software, including operating systems, games, and scientific simulations.
  • 19. High Level Programming Language JavaScript: JavaScript is a high-level, interpreted programming language that is widely used for developing web applications. JavaScript runs in web browsers and provides interactivity and dynamic behavior to web pages.
  • 20. High Level Programming Language Ruby: Ruby is a high-level, interpreted programming language that emphasizes simplicity and productivity. Ruby is widely used for web development, automation, and scripting.
  • 21. High Level Programming Language Swift: Swift is a high-level, compiled programming language developed by Apple Inc. Swift is designed for developing applications for iOS, macOS, and watchOS. Swift is known for its safety, speed, and expressiveness.
  • 22. High Level Programming Language PHP: PHP is a server-side, interpreted programming language that is widely used for developing web applications. PHP is known for its simplicity and ease of use, making it a popular choice for web developers.
  • 23. High Level Programming Language SQL: SQL (Structured Query Language) is a domain- specific language used for managing relational databases. SQL is used to create, modify, and query databases, and is widely used in business and data analysis.
  • 24. COMPUTER HARDWARE HIGH LEVEL LOW LEVEL OBJECT ORIENTED PROCEDURAL ASSEMBLY LANGUAGE MACHINE LANGUAGE
  • 27. computer programming model that organizes software design around data, or objects, rather than functions and logic. An object can be defined as a data field that has unique attributes and behavior.
  • 28. Procedural programming is about writing procedures or methods that perform operations on the data, while object-oriented programming is about creating objects that contain both data and methods. Object-oriented programming has several advantages over procedural programming: OOP is faster and easier to execute OOP provides a clear structure for the programs OOP helps to keep the Java code DRY "Don't Repeat Yourself", and makes the code easier to maintain, modify and debug OOP makes it possible to create full reusable applications with less code and shorter development time
  • 29. What is the structure of object-oriented programming? Classes are user-defined data types that act as the blueprint for individual objects, attributes and methods.
  • 30. What is the structure of object-oriented programming? Objects are instances of a class created with specifically defined data. Objects can correspond to real-world objects or an abstract entity. When class is defined initially, the description is the only object that is defined.
  • 31. What is the structure of object-oriented programming? Methods are functions that objects can perform. They are defined inside a class that describe the behaviors of an object. Each method contained in class definitions starts with a reference to an instance object. Additionally, the subroutines contained in an object are called instance methods. Programmers use methods for reusability or keeping functionality encapsulated inside one object at a time.
  • 32. What is the structure of object-oriented programming? Attributes represent the state of an object. In other words, they are the characteristics that distinguish classes. Objects have data stored in the attributes field. Class attributes belong to the class itself and are defined in the class template.
  • 34. The main principles of OOP The encapsulation principle states that all important information is contained inside an object and only select information is exposed. The implementation and state of each object are privately held inside a defined class. Other objects do not have access to this class or the authority to make changes. They are only able to call a list of public functions or methods. This characteristic of data hiding provides greater program security and avoids unintended data corruption. Encapsuation
  • 35. The main principles of OOP Objects only reveal internal mechanisms that are relevant for the use of other objects, hiding any unnecessary implementation code. The derived class can have its functionality extended. This concept can help developers more easily make additional changes or additions over time. Abstraction
  • 36. The main principles of OOP Classes can reuse code and properties from other classes. Relationships and subclasses between objects can be assigned, enabling developers to reuse common logic, while still maintaining a unique hierarchy. Inheritance forces more thorough data analysis, reduces development time and ensures a higher level of accuracy. Inheritance
  • 37. The main principles of OOP Objects are designed to share behaviors, and they can take on more than one form. The program determines which meaning or usage is necessary for each execution of that object from a parent class, reducing the need to duplicate code. A child class is then created, which extends the functionality of the parent class. Polymorphism enables different types of objects to pass through the same interface Polymorphism
  • 39. Download and Install Apache Netbeans IDE netbeans.apache.org/front/main/download/ www.oracle.com/java/technologies/downloads/?er=221886 Java Development Kit
  • 40. Every line of code that runs in Java must be inside a class. In our example, we named the class Main. A class should always start with an uppercase first letter. Note: Java is case-sensitive: "MyClass" and "myclass" has different meaning. System.out.println() println() method to print a line of text to the screen: Java Syntax public class Main { public static void main(String[] args) { System.out.println("Hello World"); } }
  • 41. Java Variables String - stores text, such as "Hello". String values are surrounded by double quotes int - stores integers (whole numbers), without decimals, such as 123 or -123 float - stores floating point numbers, with decimals, such as 19.99 or -19.99 char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes boolean - stores values with two states: true or false
  • 42. OPERATOR NAME DESCRIPTION EXAMPLE + Addition Adds together two values x + y - Subtraction Subtracts one value from another x - y * Multiplication Multiplies two values x * y / Division Divides one value by another x / y % Modulus Returns the division remainder x % y Arithmetic Operations ARITHMETIC OPERATORS ARE USED TO PERFORM COMMON MATHEMATICAL OPERATIONS.
  • 43. Java supports the usual logical conditions from mathematics: Less than: a < b Less than or equal to: a <= b Greater than: a > b Greater than or equal to: a >= b Equal to a == b Not Equal to: a != b Conditional Statements: Use if to specify a block of code to be executed, if a specified condition is true Use else to specify a block of code to be executed, if the same condition is false Use else if to specify a new condition to test, if the first condition is false Use switch to specify many alternative blocks of code to be executed Conditions and If Statements if (condition) { //block of code to be executed if condition is true }
  • 44. Write a Java program to divide two numbers and print them on the screen. Test Data : 50/3 Expected Output : 16 Write a Java program to print the results of the following operations. Test Data: a. -5 + 8 * 6 b. (55+9) % 9 c. 20 + -3*5 / 8 d. 5 + 15 / 3 * 2 - 8 % 3 Expected Output : 43 1 19 13 Write a Java program to print the sum of two numbers. Test Data: 74 + 36 Expected Output : 110 Excercises
  • 45. Write a Java program that takes two numbers as input and displays the product of two numbers. Test Data: Input first number: 25 Input second number: 5 Expected Output : 25 x 5 = 125 Write a Java program to print the sum (addition), multiply, subtract, divide and remainder of two numbers. Test Data: Input first number: 125 Input second number: 24 Expected Output : 125 + 24 = 149 125 - 24 = 101 125 x 24 = 3000 125 / 24 = 5 125 mod 24 = 5 Excercises
  • 46. Write a Java program that compute the average of 3 number Test Data : 80, 81, and 90 Expected Output : The average of 80, 81, and 90 is 83.66 Write a Java program to print the results of Fahrenheit convert to celsius Test Data: 120 Expected Output : 48.88 use this formula: (°F − 32) × 5/9 = °C Write a Java program to print the area of rectangle Test Data: Lenght = 40 and Width = 70 Expected Output : The area of L:40 and W:70 is 2800 Excercises