Computer Programming CONTENTS Introduction to Operating Systems Introduction to programming languages Introduction to perl programming language Programming.

Slides:



Advertisements
Similar presentations
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Advertisements

Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Program Design and Development
Lecture Notes 1/21/04 Program Design & Intro to Algorithms.
Chapter 1 Program Design
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
1 Programming Languages Marjan Sirjani 2 1- The Study of Programming Languages The purpose of language is simply that it must convey meaning. (Confucius)
CS102 Introduction to Computer Programming
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Introduction to High-Level Language Programming
PROGRAMMING LANGUAGES The Study of Programming Languages.
Sw development1 Software Development 1.Define the problem (Analysis) 2.Plan the solution 3.Code 4.Test and debug 5.Maintain and Document.
1 Shawlands Academy Higher Computing Software Development Unit.
Simple Program Design Third Edition A Step-by-Step Approach
Goals of Course Introduction to the programming language C Learn how to program Learn ‘good’ programming practices.
Programming Lifecycle
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
1 Programming Languages Marjan Sirjani Course web site:
1 Introduction Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Sections
Developing an Algorithm
Computer Concepts 2014 Chapter 12 Computer Programming.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Developing an Algorithm
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
Chapter 12 Computer Programming. Chapter Contents Chapter 12: Computer Programming 2  Section A: Programming Basics  Section B: Procedural Programming.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
Chapter 1 Program design Objectives To describe the steps in the program development process To introduce the current program design methodology To introduce.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
The Software Development Process
1 Program Planning and Design Important stages before actual program is written.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Engr. Isabelo Jun D. Paat, ME-CoE Lecturer 1 Programming Languages.
Intermediate 2 Computing Unit 2 - Software Development.
 Software Development Life Cycle  Software Development Tools  High Level Programming:  Structures  Algorithms  Iteration  Pseudocode  Order of.
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Introduction to programming languages, Algorithms & flowcharts
Introduction to programming languages, Algorithms & flowcharts
CSCI-235 Micro-Computer Applications
Chapter 2- Visual Basic Schneider
Algorithm and Ambiguity
Programming Problem steps must be able to be fully & unambiguously described Problem types; Can be clearly described Cannot be clearly described (e.g.
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Algorithm and Ambiguity
Introduction to programming languages, Algorithms & flowcharts
Computer Programming.
Unit# 9: Computer Program Development
Chapter 2- Visual Basic Schneider
Chapter 1 Introduction(1.1)
CHAPTER 1 Introduction to Structured Programming.
Chapter 2- Visual Basic Schneider
Algorithm and Ambiguity
Principles of Programming Languages
강의 내용 및 방법 접근방법 리포트 시험 Lambda Calculus, Proof of Correctness
Chapter 1: Preliminaries
Basic Concepts of Algorithm
Programming Logic and Design Eighth Edition
Presentation transcript:

Computer Programming

CONTENTS Introduction to Operating Systems Introduction to programming languages Introduction to perl programming language Programming skills in perl Perl applications in bioinformatics

Software Categories System SW – Programs written for computer systems Compilers, operating systems, … Application SW – Programs written for computer users Word-processors, spreadsheets, & other application packages

Operating system The set of software that controls the overall operation of a computer system, typically by performing such tasks as memory allocation, job scheduling, and input/output control Software designed to control the hardware of a specific data-processing system in order to allow users and application programs to make use of it.

OS Tasks The operating system's tasks, in the most general sense, fall into six categories: i.Processor management ii.Memory management iii.Device management iv.Storage management v.Application interface vi.User interface

Language The purpose of language is simply that it must convey meaning. (Confucius) That which can be said, can be said clearly. (Wittgenstein,1963) A program is a specification of a computation. A programming language is a notation for writing programs.(Sethi,89)

7 What is a programming language? A language that is intended for the expression of computer programs and that is capable of expressing any computer program.

What is Programming Program – a very specific set of instructions (or command lines) that making a computer do what you want it to do Programming – the process of creating a program – the development of a solution to an identified program, and setting up of a related series of instructions which, when directed through computer hardware, will produce the desired results

Differences or Similarities Natural Language – Grammar – Vocabulary – Sentences Programming Language – Syntax – Objects, data types – Commands

Steps in program development 1.Define the problem 2.Outline the solution(pseudocode) 3.Develop the outline into an algorithm 4.Test the algorithm for correctness 5.Code the algorithm into a specific programming language 6.Run the program on the computer 7.Document and maintain the program

Define the Problem Divide the problem into three components (called IPO): – Inputs – what do you have? – Outputs – what do you want to have? – Processing how do you go from inputs to outputs? A defining diagram is recommended

Outline the Solution The major processing steps involved The major subtasks (if any) The major control structures (e.g. repetition loops) The major variables and record structures The mainline logic

Develop the Outline into an Algorithm Algorithm is a set of precise steps that describe exactly the tasks to be performed, and the order in which they are to be carried out Pseudocode (a form of structured English) is used to represent the solution algorithm

Test the Algorithm for Correctness The main purpose of desk checking the algorithm is to identify major logic errors early, so that they may be easily corrected Test data needs to be walked through each step in the algorithm, to check that the instructions described in the algorithm will actually do what they are supposed to

Code the Algorithm into a Specific Programming Language Only after all design considerations have been met should you actually start to code the program into your chosen programming language (e.g. Visual Basic, Java, C++)

Run the Program on the Computer This step uses a program compiler and programmer- designed test data to machine test the code for syntax errors Program complier translate high-level languages (e.g. VB) to low-level machine language before execution

Document and Maintain the Program Not the last step in the program development process An ongoing task from the initial definition of the problem to the final test result Involves both external documentation (such as hierarchy charts) and internal documentation that may have been coded in the program

How do Programming Languages Differ? Common Constructs: basic data types (numbers, etc.); variables; expressions; statements; keywords; control constructs; procedures; comments; errors... Uncommon Constructs: type declarations; special types (strings, arrays, matrices,...); sequential execution; concurrency constructs; packages/modules; objects; general functions; generics; modifiable state;...

Pseudocode vs Algorithm Pseudocode is a compact and informal high-level description of a computer programming algorithm that uses the structural conventions of some programming language, but is intended for human reading rather than machine reading. Algorithm Procedure that produces the answer to a question or the solution to a problem in a finite number of steps. In mathematics, computing, and related subjects, an algorithm is a sequence of finite instructions, often used for calculation and data processing. It is formally a type of effective method in which a list of well-defined instructions for completing a task will, when given an initial state, proceed through a well-defined series of successive states, eventually terminating in an end-state.

Problem 1  A program is required to read three numbers, add them together and print their total.

Defining diagram InputProcessingOutput Number1 Number2 Number3 Prompt for input numbers total Get input numbers Apply addition Display total

Solution Pseudocode Begin Program Get number1 Get number2 Get number3 Total = number1 + number2 + number3 Display total End Program

Problem 2 A program is required to prompt the terminal operator for the maximum and minimum temperature readings on a particular day, accept those readings as integers, and calculate and display to the screen the average temperature, calculated by (maximum temperature + minimum temperature)/2.

Defining diagram InputProcessingOutput Max_temp Min_temp Prompt for temperatures Get temperatures Calculate average temperature Display average temperature Avg_temp

Solution Pseudocode Begin program Get max_temp, min_temp Avg_temp= (max_Temp + min_temp)/2 Output avg_temp to the screen End Program

Problem 3 Calculate the circumference and area of a circle

Defining diagram InputProcessingOutput Radius pi Get radius, pi Calculate circumference = 2 * P I* radius Calculatearea=PI * radius ^ 2 Display circumference, area Circumfere nce area

Solution Pseudocode Begin program get radius, PI circumference = 2 * P I* radius area=PI * radius * radius display circumference, area End program

29 Attributes of a good language 1.Clarity, simplicity, and unity – Have a minimum number of different concepts, with the rules for their combination, simple and regular (conceptual integrity). – readability 2.Orthogonality – Being able to combine various features of a language in all possible combinations. 3.Support for abstraction

30 Attributes of a good language 4. Ease of program verification – Proof of correctness, desk checking, test – Simplicity of semantic and syntax 5. Programming environment 6. Portability of programs 7. Cost of use – Program execution – Program translation – Program creation, testing, and use – Program maintenance

Jazayeri31 Attributes of a good language (another view: to make a software reliable, maintainable, efficient) Reliability – Writability – Readability – Simplicity – Safety (no goto, no pointers) – Robustness (undesired events can be trapped, like arithmetic overflow, invalid inputs) Maintainability – Factoring (modularity) – Locality Efficiency

Can you answer these questions? What is an OS? PL? Pseudocode vs Algorithm? Steps involved in programming? Attributes of good PL? How do PL differ? Write pseudocode for a given problem?

Assignment Uses of internet as biologists Single page