SlideShare a Scribd company logo
INTRO TO
COMPUTER
PROGRAMMING I
CSC201
What we’ll Learn
 Simple Programming Logic
 Program Development Cycle
 Integrated Development Environments(IDEs)
 Compilers and Interpreters
 Types of Errors
 Programming Paradigms
 Introduction to Java
 Principles of Good Programming
Why Program?
 Computer – programmable machine
designed to follow instructions
 Program – instructions in computer memory to
make it do something
 Programmer – person who writes instructions
(programs) to make computer perform a task
 SO, without programmers, no programs;
without programs, a computer cannot do
anything
Copyright © 2012 Pearson Education, Inc.
Computer Languages
Compilers and Interpreters
 Programs that are written in a high-
level language must be translated
into machine language
 A compiler is a program that
translates a high-level language
program into a separate machine
language program
 The machine language program
can then be executed any time it is
needed
Compilers and Interpreters
 An Interpreter is a program that both
translates and executes the
instructions in a high-level language
program.
 As the interpreter reads each
individual instruction in the program,
it converts it to machine language
instructions and then immediately
executes them
Errors
 Syntax error
a mistake such as a misspelled key word, a missing
punctuation character, or the incorrect use of an
operator.
 Logical error
The logical error is an error that leads to an undesired
output. These errors produce the incorrect output, but
they are error-free, known as logical errors.
 Semantic error
errors that occurred when the statements are not
understandable by the compiler.
Compile Time vs Run-Time errors
Compile-time Runtime
The compile-time errors are
the errors which are
produced at the compile-
time, and they are detected
by the compiler.
The runtime errors are the
errors which are not
generated by the compiler
and produce an unpredictable
result at the execution time.
In this case, the compiler
prevents the code from
execution if it detects an
error in the program.
In this case, the compiler
does not detect the error, so
it cannot prevent the code
from the execution.
It contains the syntax and
semantic errors such as
missing semicolon at the end
of the statement.
It contains the errors such as
division by zero, determining
the square root of a negative
number.
What does a programmer do?
 Understanding the problem,
planning the logic,
 Coding the program,
 Translating the program into
machine language,
 Testing the program,
 Putting the program into production,
and
 Maintaining it.
Tools Used to Write
Programs
1.Text Editor
 A text editor is a type of computer
program that edits plain text
 Text editors are embedded in operating
systems and software development
packages,
 Used to change files such as
configuration files, documentation files
and used to write program source
codes.
Integrated Development Environment
 A software application that provides
comprehensive facilities to computer
programmers for software development.
 IDEs present a single program in which all
development is done.
 It provides many features for authoring,
modifying, compiling, deploying and
debugging software
 The package should contain at least:
 Source Code editor
 Compiler
 Build Automation Tools
 Debugger
Benefits of Using IDE
Faster Set-Up
Developers have the same set of capabilities in
one place, without the need for constantly
switching tools.
Faster development tasks
Tighter integration of all development tasks
improves developer productivity
Improves Organisation
IDE’s tools and features helps developers
organize resources, prevent mistakes and
take shortcuts.
Programming
Paradigms
Procedural Programming
 Derived from structured programming,
based upon the concept of calling
procedure.
 e.g FORTRAN, ALGOL, COBOL, BASIC,
Pascal and C.
OOP
 Based upon the concept of objects.
 Objects contain data in the form of
attributes and code in the form of
methods.
 e.g Java, C++, C#, Python, PHP,
JavaScript, Ruby, Perl, Objective-C, Dart,
Swift, Scala.
BASIS OF COMPARISON OBJECT ORIENTED
PROGRAMMING (OOP)
PROCEDURAL ORIENTED
PROGRAMMING (POP)
Division Of Program
In object oriented
programming, program is
divided into parts
referred to as objects.
In procedural oriented
programming, program is
divided into small parts
referred to as functions.
Data Movement
Objects can move and
communicate with each
other through member
function.
Data can move freely
from function to function
in the system.
Importance
Importance is given to
the data rather than
procedures or functions
because it works as
a real world.
Importance is not given
to data but to functions
as well as sequence of
actions to be done.
Approach
Object oriented
programming follows
Bottom Up approach.
Procedural oriented
programming follows Top
Down approach.
BASIS OF COMPARISON
OBJECT ORIENTED
PROGRAMMING (OOP)
PROCEDURAL ORIENTED
PROGRAMMING (POP)
Code Reusability
The existing code in object
oriented programming can
be reused by the feature
referred to as inheritance.
There is no such feature in
procedural oriented
programming.
Addition of New Data And
Function
In object oriented
programming, adding new
data and function is easy.
Adding new data and
function is not easy in
procedural oriented
programming.
Problem Size
It is suitable for solving big
problems.
It is not suitable for solving
big problems.
Data Access
In object oriented
programming, data cannot
move easily from function to
function, it can be kept
public or private so we can
control the access of data.
In procedural oriented
programming, most function
uses global data for sharing
that can be accessed freely
from function to function in
the system.
Examples
Examples of object oriented
programming languages
include: C++, Java, VB.NET,
C#.NET and Python.
C, VB, Fortran and Pascal
are common examples of
procedure oriented
languages.
BASIS OF COMPARISON OBJECT ORIENTED
PROGRAMMING (OOP)
PROCEDURAL ORIENTED
PROGRAMMING (POP)
Virtual Classes
Concept of virtual
function appears during
inheritance.
No concept of virtual
classes.
Most Important Attribute
Data is more important
than function.
Function is more
important than data.
Access Modes
In Object oriented
programming, there are
three accessing modes
“public”, “private”,
“protected’’ that are
used as an accessing
share to access attributes
or functions.
In procedural oriented
programming, there is no
specific accessing mode
to access attributes or
functions in the program.
Introduction To Java
 James Gosling (a Canadian computer scientist),
at Sun Labs, around 1992 Invented Java.
 Used to build visually interesting graphical user
interface (GUI) and Web-based applications.
 Java is supported by many operating system,
 Java is cross-platformed OR platform
independent.
Properties Of Java
1. JAVA IS A ROBUST LANGUAGE -The main features of java that makes
it robust are garbage collection, Exception Handling and
memory allocation.
2. JAVA IS SECURE - A lot of security futures are built into java that
makes it secure. That is why several security flaws are almost
impossible to exploit in Java (examples of such security flaws arestack
corruption or buffer overflow).
3. MULTITHREADING -. Multithreading is a Java feature that allows
concurrent execution of two or more parts of a program for
maximum utilisation of CPU.
4. PORTABLE - “Write once, run anywhere” (WORA) is a slogan
developed by Sun Microsystems to describe the ability of one Java
program version to work correctly on multiple platforms.
Editions of Java
 Java Platform, Standard Edition (Java SE) is the Java platform
for developing client- side applications, which run on desktops,
and applets, which run in web browsers
 Java Platform, Enterprise Edition (Java EE) is the Java platform
built on top of Java SE, which is used exclusively to develop
enterprise-oriented server applications. Server- side
applications include servlets, which are Java programs that
are similar to applets but run on a server rather than a client
 Java Platform, Micro Edition (Java ME) is also built on top of
Java SE. It is the Java platform for developing MIDlets, which
are Java programs that run on mobile information devices,
and Xlets, which are Java programs that run on embedded
devices (eg ATMs, printers, calculators, thermostats .....)
Java Program
Execution
 -A Java bytecode is a
machine instruction for a
Java processor. A file of
bytecodes is a machine
language program for a
Java processor.
 The javac program is a
compiler (a translator) that
translates the source
program into a bytecode file
called Hello.class.
Java Environment
 JDK: Java Development - Kit, The JDK is a software development
environment used for developing Java applications and applets.
It includes the Java Runtime Environment (JRE), an
interpreter/loader (java), a compiler (javac), an archiver (jar), a
documentation generator (javadoc) and other tools needed in
Java development.
 JRE: Java Run-time Environment is an environment where Java
applications only be ran and not developed (client system). It is
part of the Java Development Kit (JDK), and provides the
minimum requirements for executing a Java application; it
consists of the Java Virtual Machine (JVM), core classes, and
supporting files.
 JVM: Java Virtual Machine, is the environment responsible for the
actual execution of a Java program
Principles of Good Programming
 DON’T REPEAT YOURSELF
As soon as you start repeating yourself (e.g. a long expression, a series of
statements, same concept) create a new abstraction.
 ABSTRACTION
Each significant piece of functionality in a program should be
implemented in just one place in the source code.
 AVOID REDUNDANCE
You should try not to add functionality until you need it.
 SIMPLICITY
Simple code takes less time to write, has fewer bugs and is easier to modify.
Principles of Good Programming
 EASILY READABLE
The code should be easily read and understood with a minimum of effort
required.
 Extension/Modification
Software entities (classes, modules, functions, etc.) should be open for
extension,
but closed for modification. In other words, do not write classes that people
can modify. Write classes that people can extend.
 Code Re-Usability
Reusing code improves code reliability and decreases development time.
 Avoid Premature Optimization
 Minimize Coupling
 All modules should be independent as far as possible”Maintainability
Code Should be Maintainable

More Related Content

DOC
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
AmanGunner
 
PPTX
Introduction to java
Kalai Selvi
 
PDF
Object Oriented Programming slides that can help students
vincentngong2
 
PDF
Java Programming Basics
Rkrishna Mishra
 
PPTX
Unit1 introduction to Java
DevaKumari Vijay
 
PDF
report
Diptika Shukla
 
PPTX
Java ms harsha
Harsha Batra
 
PPTX
JRE , JDK and platform independent nature of JAVA
Mehak Tawakley
 
ICT-DBA4 -05-0811-Apply-Object-Oriented-Programming-Language-Skills.doc
AmanGunner
 
Introduction to java
Kalai Selvi
 
Object Oriented Programming slides that can help students
vincentngong2
 
Java Programming Basics
Rkrishna Mishra
 
Unit1 introduction to Java
DevaKumari Vijay
 
report
Diptika Shukla
 
Java ms harsha
Harsha Batra
 
JRE , JDK and platform independent nature of JAVA
Mehak Tawakley
 

Similar to CSC201_8374838384848838e8e8r88r8r88r8.pptx (20)

PPTX
Types of system software
Inderbir Kaur Sandhu
 
DOCX
java introduction.docx
vikasbagra9887
 
DOCX
HR OPERATION MANAGER
Venkatesh Gupta
 
DOCX
Notes of java first unit
gowher172236
 
PPT
Core java slides
Abhilash Nair
 
PPTX
GMR PROJECT PPT
Anuj Gulati
 
PPT
Core Java Slides
Vinit Vyas
 
PPTX
Introduction to system programming
sonalikharade3
 
PPT
Java presentation
Karan Sareen
 
PPT
Java2020 programming basics and fundamentals
swecsaleem
 
PPTX
Insight into progam execution ppt
Keerty Smile
 
PPTX
Software ppt
switipatel4
 
PPTX
JAVA FEATURES
shalinikarunakaran1
 
PPTX
Java Intro
Nazmul Hasan Rupok
 
PPTX
Java Programming Tutorials Basic to Advanced 1
JALALUDHEENVK1
 
DOCX
JAVA
sonali_iul
 
DOCX
Unit 1
ankita1317
 
PPT
Chapter 1 introduction to java technology
sshhzap
 
PPTX
Computer Hardware Technology PowerPoint Templates (1).pptx
pakistannewsworldnew
 
PPT
Java1
computertuitions
 
Types of system software
Inderbir Kaur Sandhu
 
java introduction.docx
vikasbagra9887
 
HR OPERATION MANAGER
Venkatesh Gupta
 
Notes of java first unit
gowher172236
 
Core java slides
Abhilash Nair
 
GMR PROJECT PPT
Anuj Gulati
 
Core Java Slides
Vinit Vyas
 
Introduction to system programming
sonalikharade3
 
Java presentation
Karan Sareen
 
Java2020 programming basics and fundamentals
swecsaleem
 
Insight into progam execution ppt
Keerty Smile
 
Software ppt
switipatel4
 
JAVA FEATURES
shalinikarunakaran1
 
Java Intro
Nazmul Hasan Rupok
 
Java Programming Tutorials Basic to Advanced 1
JALALUDHEENVK1
 
JAVA
sonali_iul
 
Unit 1
ankita1317
 
Chapter 1 introduction to java technology
sshhzap
 
Computer Hardware Technology PowerPoint Templates (1).pptx
pakistannewsworldnew
 
Ad

Recently uploaded (20)

PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Software Development Methodologies in 2025
KodekX
 
PPTX
Comunidade Salesforce SĂŁo Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira JĂșnior
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
Software Development Company | KodekX
KodekX
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Software Development Methodologies in 2025
KodekX
 
Comunidade Salesforce SĂŁo Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira JĂșnior
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
Software Development Company | KodekX
KodekX
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Ad

CSC201_8374838384848838e8e8r88r8r88r8.pptx

  • 2. What we’ll Learn  Simple Programming Logic  Program Development Cycle  Integrated Development Environments(IDEs)  Compilers and Interpreters  Types of Errors  Programming Paradigms  Introduction to Java  Principles of Good Programming
  • 3. Why Program?  Computer – programmable machine designed to follow instructions  Program – instructions in computer memory to make it do something  Programmer – person who writes instructions (programs) to make computer perform a task  SO, without programmers, no programs; without programs, a computer cannot do anything Copyright © 2012 Pearson Education, Inc.
  • 5. Compilers and Interpreters  Programs that are written in a high- level language must be translated into machine language  A compiler is a program that translates a high-level language program into a separate machine language program  The machine language program can then be executed any time it is needed
  • 6. Compilers and Interpreters  An Interpreter is a program that both translates and executes the instructions in a high-level language program.  As the interpreter reads each individual instruction in the program, it converts it to machine language instructions and then immediately executes them
  • 7. Errors  Syntax error a mistake such as a misspelled key word, a missing punctuation character, or the incorrect use of an operator.  Logical error The logical error is an error that leads to an undesired output. These errors produce the incorrect output, but they are error-free, known as logical errors.  Semantic error errors that occurred when the statements are not understandable by the compiler.
  • 8. Compile Time vs Run-Time errors Compile-time Runtime The compile-time errors are the errors which are produced at the compile- time, and they are detected by the compiler. The runtime errors are the errors which are not generated by the compiler and produce an unpredictable result at the execution time. In this case, the compiler prevents the code from execution if it detects an error in the program. In this case, the compiler does not detect the error, so it cannot prevent the code from the execution. It contains the syntax and semantic errors such as missing semicolon at the end of the statement. It contains the errors such as division by zero, determining the square root of a negative number.
  • 9. What does a programmer do?  Understanding the problem, planning the logic,  Coding the program,  Translating the program into machine language,  Testing the program,  Putting the program into production, and  Maintaining it.
  • 10. Tools Used to Write Programs 1.Text Editor  A text editor is a type of computer program that edits plain text  Text editors are embedded in operating systems and software development packages,  Used to change files such as configuration files, documentation files and used to write program source codes.
  • 11. Integrated Development Environment  A software application that provides comprehensive facilities to computer programmers for software development.  IDEs present a single program in which all development is done.  It provides many features for authoring, modifying, compiling, deploying and debugging software  The package should contain at least:  Source Code editor  Compiler  Build Automation Tools  Debugger
  • 12. Benefits of Using IDE Faster Set-Up Developers have the same set of capabilities in one place, without the need for constantly switching tools. Faster development tasks Tighter integration of all development tasks improves developer productivity Improves Organisation IDE’s tools and features helps developers organize resources, prevent mistakes and take shortcuts.
  • 13. Programming Paradigms Procedural Programming  Derived from structured programming, based upon the concept of calling procedure.  e.g FORTRAN, ALGOL, COBOL, BASIC, Pascal and C. OOP  Based upon the concept of objects.  Objects contain data in the form of attributes and code in the form of methods.  e.g Java, C++, C#, Python, PHP, JavaScript, Ruby, Perl, Objective-C, Dart, Swift, Scala.
  • 14. BASIS OF COMPARISON OBJECT ORIENTED PROGRAMMING (OOP) PROCEDURAL ORIENTED PROGRAMMING (POP) Division Of Program In object oriented programming, program is divided into parts referred to as objects. In procedural oriented programming, program is divided into small parts referred to as functions. Data Movement Objects can move and communicate with each other through member function. Data can move freely from function to function in the system. Importance Importance is given to the data rather than procedures or functions because it works as a real world. Importance is not given to data but to functions as well as sequence of actions to be done. Approach Object oriented programming follows Bottom Up approach. Procedural oriented programming follows Top Down approach.
  • 15. BASIS OF COMPARISON OBJECT ORIENTED PROGRAMMING (OOP) PROCEDURAL ORIENTED PROGRAMMING (POP) Code Reusability The existing code in object oriented programming can be reused by the feature referred to as inheritance. There is no such feature in procedural oriented programming. Addition of New Data And Function In object oriented programming, adding new data and function is easy. Adding new data and function is not easy in procedural oriented programming. Problem Size It is suitable for solving big problems. It is not suitable for solving big problems. Data Access In object oriented programming, data cannot move easily from function to function, it can be kept public or private so we can control the access of data. In procedural oriented programming, most function uses global data for sharing that can be accessed freely from function to function in the system. Examples Examples of object oriented programming languages include: C++, Java, VB.NET, C#.NET and Python. C, VB, Fortran and Pascal are common examples of procedure oriented languages.
  • 16. BASIS OF COMPARISON OBJECT ORIENTED PROGRAMMING (OOP) PROCEDURAL ORIENTED PROGRAMMING (POP) Virtual Classes Concept of virtual function appears during inheritance. No concept of virtual classes. Most Important Attribute Data is more important than function. Function is more important than data. Access Modes In Object oriented programming, there are three accessing modes “public”, “private”, “protected’’ that are used as an accessing share to access attributes or functions. In procedural oriented programming, there is no specific accessing mode to access attributes or functions in the program.
  • 17. Introduction To Java  James Gosling (a Canadian computer scientist), at Sun Labs, around 1992 Invented Java.  Used to build visually interesting graphical user interface (GUI) and Web-based applications.  Java is supported by many operating system,  Java is cross-platformed OR platform independent.
  • 18. Properties Of Java 1. JAVA IS A ROBUST LANGUAGE -The main features of java that makes it robust are garbage collection, Exception Handling and memory allocation. 2. JAVA IS SECURE - A lot of security futures are built into java that makes it secure. That is why several security flaws are almost impossible to exploit in Java (examples of such security flaws arestack corruption or buffer overflow). 3. MULTITHREADING -. Multithreading is a Java feature that allows concurrent execution of two or more parts of a program for maximum utilisation of CPU. 4. PORTABLE - “Write once, run anywhere” (WORA) is a slogan developed by Sun Microsystems to describe the ability of one Java program version to work correctly on multiple platforms.
  • 19. Editions of Java  Java Platform, Standard Edition (Java SE) is the Java platform for developing client- side applications, which run on desktops, and applets, which run in web browsers  Java Platform, Enterprise Edition (Java EE) is the Java platform built on top of Java SE, which is used exclusively to develop enterprise-oriented server applications. Server- side applications include servlets, which are Java programs that are similar to applets but run on a server rather than a client  Java Platform, Micro Edition (Java ME) is also built on top of Java SE. It is the Java platform for developing MIDlets, which are Java programs that run on mobile information devices, and Xlets, which are Java programs that run on embedded devices (eg ATMs, printers, calculators, thermostats .....)
  • 20. Java Program Execution  -A Java bytecode is a machine instruction for a Java processor. A file of bytecodes is a machine language program for a Java processor.  The javac program is a compiler (a translator) that translates the source program into a bytecode file called Hello.class.
  • 21. Java Environment  JDK: Java Development - Kit, The JDK is a software development environment used for developing Java applications and applets. It includes the Java Runtime Environment (JRE), an interpreter/loader (java), a compiler (javac), an archiver (jar), a documentation generator (javadoc) and other tools needed in Java development.  JRE: Java Run-time Environment is an environment where Java applications only be ran and not developed (client system). It is part of the Java Development Kit (JDK), and provides the minimum requirements for executing a Java application; it consists of the Java Virtual Machine (JVM), core classes, and supporting files.  JVM: Java Virtual Machine, is the environment responsible for the actual execution of a Java program
  • 22. Principles of Good Programming  DON’T REPEAT YOURSELF As soon as you start repeating yourself (e.g. a long expression, a series of statements, same concept) create a new abstraction.  ABSTRACTION Each significant piece of functionality in a program should be implemented in just one place in the source code.  AVOID REDUNDANCE You should try not to add functionality until you need it.  SIMPLICITY Simple code takes less time to write, has fewer bugs and is easier to modify.
  • 23. Principles of Good Programming  EASILY READABLE The code should be easily read and understood with a minimum of effort required.  Extension/Modification Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. In other words, do not write classes that people can modify. Write classes that people can extend.  Code Re-Usability Reusing code improves code reliability and decreases development time.  Avoid Premature Optimization  Minimize Coupling  All modules should be independent as far as possible”Maintainability Code Should be Maintainable