0% found this document useful (0 votes)
66 views14 pages

Lecture 1

The document provides an overview of computers and programming languages. It defines a computer as a machine that performs calculations and processes information. It describes hardware as the physical components of a computer and software as the programs that control hardware. It then discusses different types of software, programming languages, why to study programming, and features of the Java programming language.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views14 pages

Lecture 1

The document provides an overview of computers and programming languages. It defines a computer as a machine that performs calculations and processes information. It describes hardware as the physical components of a computer and software as the programs that control hardware. It then discusses different types of software, programming languages, why to study programming, and features of the Java programming language.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Hello world!!!

   
What is a Computer?
A computer is a machine that performs calculations and
processes information.
● Hardware refers to the electronic and mechanical components
of a computer
● Software refers to the programs that control the hardware.

   
   
Software
There are two types of software:
● Application software – provide particular task or 
service. Ex: word processors, computer games, 
spreadsheet programs, Web browsers...
● System software – programs that include basic 
operations that make a computer usable. Ex: 
operating system, which includes drivers, 
protocols,...

   
Why Study Programming?

● Computer programming is the art and science of


designing and writing programs
● One reason to study programming might be to enter into a
career as a computer scientist
● It is a creative and enjoyable problem solving activity
● Designing and building well-written programs provides a
powerful sense of accomplishment and satisfaction.

   
Programming Languages

● Most computer programs today are written in a high-level


language, such as Java, C, C++, or FORTRAN
● PL is considered high-level, if its statements resemble
English-language statements.
● COBOL(Common-Business Oriented-Language) is used
in commercial applications
● FORTRAN(FORmula TRANlator) is widely used by some
engineers and mathematicians.
● C/C++ are still primary languages preferred by OS
programmers.

   
Programming Languages­2

● In addition, high­level languages use symbols and notations, 
understandable by humans. 
● For example, arithmetics operations in Java make use of 
familiar operations such as “+”, “­”, “*”, “/”, so that 
arithmetic expressions look like those in algebra.
● Ex: to calculate average of 2 numbers, you might use the 
expression:            (a + b) / 2
Programming language ­> machine language ­> CPU or 
microprocessor ­> result.
● Macintosh has Power­PC chip, Windows has Pentium chip, so... 
platform dependent.

   
Programming language­3

● In general, machine languages are based on binary codes, 
a two­value system that is well suited for electronic 
devices. 
● In binary system everything is considered  in terms of 1's 
and 0's which closely corresponds to “on” and “off” 
states of transistors.
● For example, in binary code, the number 13 would be
represented as 1101. Similarly, a particular address in
the computer's memory might be represented as
01100011, and an instruction in the computer's
instruction set might be represented as 001100.

   
PL­4(translators)

Source code translators come in two varieties:
● Interpreter – translates line by line
● Compiler – translates entire source code

   
Why Java?

● By Sun Microsystems, 1991


● Originally named "Oak" after a tree outside the office of its
developer, James Goslin, Java is a relatively young
programming language
● Initially, for embedding programs into electronic consumer
devices, such as microwave ovens and home security
systems
● As Internet was getting its popularity, Java has become
one of the most important languages for Web and
Internet applications.

   
Features
1. Java is object­oriented
● Object-oriented languages divide programs into separate modules,
called objects, that encapsulate the program's data and
operations.

2. Java is robust
● meaning that errors in Java programs don't cause system crashes
as often as errors in other programming languages. Certain
features of the language enable many potential errors to be
detected before a program is run.

   
Features­2

3. Java is platform­independent
● A platform, in this context, is just a particular kind of computer
system, such as a Macintosh or Windows system. Java's
trademark is "Write once, run anywhere." This means that a
Java program can be run without changes on different kinds of
computers.

4. Java is secure language
● Designed to be used on networks, Java contains features that
protect against untrusted code, code that might introduce a virus
or corrupt your system in some way

   
Exercise 1: Explain the difference between each of the 
following pairs of concepts.

✔ hardware and software
✔ systems software and application software
✔ compiler and interpreter
✔ machine language and high­level language
✔ source code and byte code
✔ Oak and Java
✔ COBOL and FORTRAN

   
Thank you!

   

You might also like