Programming Languages

Slides:



Advertisements
Similar presentations
Programming for Beginners
Advertisements

1 G54PRG Programming Lecture 1 Amadeo Ascó Adam Moore G54PRG Programming Lecture 1 Amadeo Ascó 3 Java Programming Language.
Senem Kumova Metin Introduction to Programming CS 115 Introduction to Computing PART I : Computer Basics PART II: Introduction to Computing/Programming.
The Central Processing Unit (CPU) Understanding Computers.
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Chapter 1 An Overview of Computers and Programming Languages.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
Overview of Programming and Problem Solving ROBERT REAVES.
 Computer hardware components are the physical pieces of the computer.  The major hardware components of a computer are: – The central processing.
 The central processing unit (CPU) interprets and executes instructions.  The “brains” of the computer.  The speed of the processor is how fast it.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Requirements Analysis Activity Diagrams b511.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis.
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
COMP Computer Basics Yi Hong May 13, 2015.
Computers: Software Patrice Koehl Computer Science UC Davis.
1 I.Introduction to Algorithm and Programming Algoritma dan Pemrograman – Teknik Informatika UK Petra 2009.
How Computers Work. A computer is a machine f or the storage and processing of information. Computers consist of hardware (what you can touch) and software.
Chapter 1 An Overview of Computers and Programming Languages.
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
1 CSC 1401 S1 Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University
Topics Introduction Hardware and Software How Computers Store Data
Computer Hardware and Software Chapter 1. Overview Brief History of Computers Hardware of a Computer Binary and Hexadecimal Numbers Compiling vs. Interpreting.
MAC OS – Unit A Page: 10-11, Investigating Data Processing Understanding Memory.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Computer Parts. Two Basic Parts Hardware & Software.
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
Basic of Programming Language Skill Area Computer System Computer Program Programming Language Programmer Translators.
School of Computer Science & Information Technology G6DICP Introduction to Computer Programming Milena Radenkovic.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
Submitted To: Rutvi sarang Submitted By: Kushal Bhagat.
Chapter 1: - What is a Computer? - Hardware. - Software. - Types of Computers. - Numeral Systems. - Data Sizes and Speeds. - Data Coding and Information.
Computer Systems. Bits Computers represent information as patterns of bits A bit (binary digit) is either 0 or 1 –binary  “two states” true and false,
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
COMPUTER SYSTEM A computer system is define as combination of components designed to process data and store files. A computer system consists of four.
Chapter 1 An Overview of Computers and Programming Languages.
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. Introduction to Computers and Computing.
Computer Basics.
Computer Architecture and Number Systems
CSC235 Computer Organization & Assembly Language
What Do Computers Do? A computer system is
Java Programming: From the Ground Up
The Central Processing Unit (CPU)
Assembler, Compiler, MIPS simulator
Unit 2 Technology Systems
Assembly Language (CSW 353)
Programming Language Hierarchy, Phases of a Java Program
CSCI-235 Micro-Computer Applications
Computer Programming.
Chapter 1: An Overview of Computers and Programming Languages
Lecture 1: Introduction to JAVA
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Elements of a Computer System
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Introduction to Computer Architecture
CS101 Introduction to Computing Lecture 19 Programming Languages
Introduction to Computer Programming
Computers & Programming Languages
Chapter One: Introduction
Programming Fundamentals (750113) Ch1. Problem Solving
Topics Introduction Hardware and Software How Computers Store Data
Chapter 2: Computer Hardware
Chapter 1 Introduction(1.1)
ICT Programming Lesson 1:
Information Technology Department
ICS103 Programming in C 1: Overview of Computers And Programming
Programming Logic and Design Eighth Edition
Presentation transcript:

Programming Languages 2 Programming Languages

Previously What is a computer? Components Encoding Fast processor of data (input) to produce a result (output) Components Hardware Software BIOS, OS, Programs Encoding Units of storage Bit, Byte, KB, MB, GB and TB Representations Decimal, binary and hexadecimal CPU Power and data cables Speaker Ventilation Memory Hard drive RAM Power supply Motherboard Speed in a computer is normally measured by the clock speed of the CPU, units Hertz (Hz, cycles per second). In computers today in the order of 2GHz. Hardware

Overview What is a programming language? Languages by implementation Language by paradigm Simple initial design

What is a programming language? Set of grammatical rules for instructing a computer to perform specific tasks Languages based on their hierarchy; on how close they are to what the computer understands Machine Language Assembly Language High Level Languages C Pascal Fortran C++ C# Java LOWER HIGHER

Languages by implementation Machine language The lowest-level programming language Collection of binary digits (bits) that the computer reads and execute Machine language is the only language a computer is capable of understanding Assembly language symbolic representation of the binary machine codes and other constants needed to program a particular CPU architecture

Languages by implementation Compiled languages Languages that require a compiler program to turn programming source code into an executable machine-language binary program Stages Write source code Compile the written code by executing the compiler Output is the executable file (application); machine code Execute application Examples: Fortran, Pascal, C and C++

Languages by implementation Interpreted languages Interpreted program is converted to binary at runtime, by an interpreter program Java is an interpreted language The interpreter program is the Java Virtual Machine (JVM) Source Code Storage CPU/Memory Interpreter Machine Code Program Executed

Languages by implementation Interpreted languages (cont.) Interpreted languages tend to be slower than compiled ones Do not require compilers Usually easier to program than compiled languages Run in different machine without need to re-compile (just if machine has installed the interpreter) Specifically in Java there are mostly a free Java Library for everything

Language by paradigm Procedural Concurrent Object Oriented Derived from structured programming Series of computational steps to be carried out Concurrent Use element of concurrency Elements: threads, distributed computing, shared resources, message passing Object Oriented Uses objects; data structures consisting of data fields (information) and methods (functionality)

Simple initial design Create sequence of instructions to make two cups of tea Fill Kettle Boil Kettle Make tea - Get kettle - Go to tap - Put kettle under tap - Open tap - Wait until kettle full - Close tap - Place kettle on hob - Switch kettle on - Wait until boiling - Switch kettle off Get two cups Get two spoons - Get two tea bags Get sugar Put tea bags in cups Fill cups Serve cups, spoons & sugar The idea is that design starts by understanding the problem, followed by expressing what it is required in a simple way. Pseudocode helps to achieve it. “Pseudocode is a compact and informal high-level description of a computer programming algorithm that uses the structural conventions of a programming language, but is intended for human reading rather than machine reading” Wikipedia online. Different levels of Pseudocode depending of how close is to normal language or to programming language.

Simple initial design Different diagrams to represent what it is required Flow Chart Unified Modelling Language (UML) Includes a set of graphic notation techniques to create visual models of software Behaviour diagrams Used extensively to describe the functionality of software systems Activity diagram: describes the business and operational step-by-step workflows of components in a system. UML state machine diagram: describes the states and state transitions of the system. Use case diagram: describes the functionality provided by a system in terms of actors, their goals represented as use cases, and any dependencies among those use cases.

Simple initial design Make two cups of tea Fill Kettle - Get kettle Go to tap Fill Kettle Put kettle under tap - Get kettle - Go to tap - Put kettle under tap - Open tap - Wait until kettle full - Close tap Open tap Wait no Full? yes Close tap

Simple initial design Fill Kettle ... Boil Kettle Place kettle on hob Boil Kettle Switch kettle on - Place kettle on hob - Switch kettle on - Wait until boiling - Switch kettle off Wait no Boiling? yes Switch kettle off

Serve cups, spoons & sugar Simple initial design Fill Kettle Get two cups ... Get two spoons Boil Kettle ... Make tea Get two tea bags Get two cups Get two spoons - Get two tea bags Get sugar Put tea bags in cups Fill cups Serve cups, spoons & sugar Get sugar Put tea bags in cups Fill cups Serve cups, spoons & sugar

Serve cups, spoons & sugar Simple initial design Make two cups of tea Make tea Fill Kettle Boil Kettle Get two cups Get kettle Place kettle on hob Get two spoons Go to tap Switch kettle on Get two tea bags Put kettle under tap Wait Get sugar Open tap no Boiling? Put tea bags in cups Wait yes no Switch kettle off Full? Fill cups yes Close tap Serve cups, spoons & sugar

Simple initial design Divide project into smaller and simpler subprojects Use pseudocode to represent the project May help to understand the problem Simplify the coding Simpler to understand, more event for no programmers Flow chart may help to show the project to others Always document what you design and code Other graphical approaches exist to help in the design stage. We’ll see more about coding using Javadoc.