Programming.

Slides:



Advertisements
Similar presentations
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Advertisements

 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
INTRODUCTION Chapter 1 1. Java CPSC 1100 University of Tennessee at Chattanooga 2  Difference between Visual Logic & Java  Lots  Visual Logic Flowcharts.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Chapter 16 Programming and Languages: Telling the Computer What to Do.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the.
Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming.
C++ Crash Course Class 1 What is programming?. What’s this course about? Goal: Be able to design, write and run simple programs in C++ on a UNIX machine.
Activity 1 - WBs 5 mins Go online and spend a moment trying to find out the difference between: HIGH LEVEL programming languages and LOW LEVEL programming.
1 I.Introduction to Algorithm and Programming Algoritma dan Pemrograman – Teknik Informatika UK Petra 2009.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
1 Chapter-01 Introduction to Computers and C++ Programming.
Introduction to High-Level Language Programming
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Programming. What is a Program ? Sets of instructions that get the computer to do something Instructions are translated, eventually, to machine language.
CSC-115 Introduction to Computer Programming
Programming Lifecycle
Program Development Life Cycle (PDLC)
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Programming Errors. Errors of different types Syntax errors – easiest to fix, found by compiler or interpreter Semantic errors – logic errors, found by.
Programming and Languages Dept. of Computer and Information Science IUPUI.
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
OCR A Level F453: The function and purpose of translators Translators a. describe the need for, and use of, translators to convert source code.
Software Engineering Algorithms, Compilers, & Lifecycle.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Computer Language
Evolution and History of Programming Languages
Lecture 1b- Introduction
Development Environment
Component 1.6.
Introduction to programming
Operating System Interface between a user and the computer hardware
Lecture 1 Introduction Richard Gesick.
CSCI-235 Micro-Computer Applications
Computer Programming.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
A451 Theory – 7 Programming 7A, B - Algorithms.
Introduction CSE 1310 – Introduction to Computers and Programming
Algorithm and Ambiguity
TRANSLATORS AND IDEs Key Revision Points.
Introduction to Computer Programming
Compiler Construction
High Level Programming Languages
An Introduction to Structured Program Design in COBOL
Chapter 1 Introduction(1.1)
Chapter One: An Introduction to Programming and Visual Basic
The Programming Process
Algorithm and Ambiguity
PROGRAMMING FUNDAMENTALS Lecture # 03. Programming Language A Programming language used to write computer programs. Its mean of communication between.
ICT Programming Lesson 1:
Lecture 8 Programming Paradigm & Languages. Programming Languages The process of telling the computer what to do Also known as coding.
ICT Gaming Lesson 2.
Tonga Institute of Higher Education IT 141: Information Systems
An Introduction to Programming with C++ Fifth Edition
Tonga Institute of Higher Education IT 141: Information Systems
1.3.7 High- and low-level languages and their translators
Programming Logic and Design Eighth Edition
Presentation transcript:

Programming

Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the computers what to do so that the computers do useful things Software on modern computers usually requires many instructions, millions sometimes so programmers work together in teams at software development companies

Programming skills Programmers need skills to write good programs Some can be learned, some are innate They need to be good communicators, both with machines and with people They should enjoy logic and mental puzzles Ideally they also have knowledge of the domain where their programs will be used

Algorithms “Step-by-step procedure” is a mouthful. We have a name for that: an algorithm. A “well-ordered collection of unambiguous and effectively computable operations that, when executed, produces a result and halts in a finite amount of time.” [Schneider and Gersting]. Steps can be described in English or other natural languages, or programming languages

Programming Languages The first computer language was machine language, written in binary (first generation) Humans found it very very tedious Simple actions took hundreds of machine steps Humans had to translate their desired steps into machine instructions and then punch them in or toggle switches to make it happen

Assembly languages Soon the computer operators wanted an easier language to use (second generation) Assembly languages look a little like English STO 4, X JMP LAB1 ADD 23, X OUT X Still lots of steps but a little more understandable, “human-readable”

Assembly languages But assembly language programs had to be translated back to machine code to be useful Machine code is the only language CPUs know The translating program is called an assembler There are still jobs for people who are good at assembly languages. Assembly is still used in game consoles, appliances, chips controlling machines, etc.

Higher Level Languages People still wanted easier languages to use, ones that were closer to how humans think instead of how computers work, more abstract (third generation, high-level languages) FORTRAN was the first commercially successful high-level language (Formula Translator), done in the 1950’s

Compilers High-level languages also need translator programs – they are called compilers and interpreters Other high-level languages are COBOL, Basic (all kinds of versions), C, C++, Java, Perl, Python Some have free translators, some translators cost money

How to Program Any programmer will have a routine to follow when given an assignment or deciding what they want to program UNDERSTAND THE PROBLEM – first! Sometimes they work through it by hand, sometimes they have to ask the customer / manager / employer questions about the details

How to, Part 2 Make a plan! A test plan! Involves thinking about how to test the program Testing? It does not exist yet! But this early planning can give insights into how to solve the problem Make a design = writing an algorithm in pseudocode Pseudocode is a structured English, with no strict rules It’s a way to write a rough draft of a program before it actually gets put into a programming language

Test Plan Test Case Description Inputs Expected Outputs Actual Outputs Normal score in A range 92 A Normal score in B range 84 B Normal score in C range 72 C Error due to wrong size of score -23 Error message about value Error due to wrong type of input undetermined

A Design in pseudocode Open the file for reading Get all the data from the file into a list Close the file Start the total at zero For each item in the list Add the value of the item to a total If the value is larger than 75, display a message Display the total

Programming Languages Languages (human and computer) have syntax and semantics The rules you learned in grammar school about spelling, punctuation, subject/verbs, parts of speech, etc. were syntax rules for English Programming languages have much stricter rules and will not work if you don’t follow them

Semantics The semantics of a human language is the meaning that the statements convey, the idea that you are trying to send from your brain to your listeners’ brains. The semantics of a programming language is what does the computer do when the program is translated to machine code and run by the CPU

Syntax to a human is not strictly necessary, we can get meaning from a statement which does not have perfect syntax (things like Twitter messages and text messages, for example) Syntax to a computer is required to be correct, so programmers have to have pretty good memories to remember the rules of the language

Errors When an English statement has an error, misspelling, wrong punctuation, wrong word, etc., we can usually figure out what is meant When a program has a syntax error, it cannot be translated, so it’s useless. Programmers get good at fixing syntax errors When a program has a semantics error, it is not doing what the programmer meant it to do (that’s called a bug)

Debugging Debugging (fixing mistakes in programs) is an art Programmers have tools to help them do this, but it is difficult. That’s one reason software packages have various versions. Bugs get fixed and the fixes are released to the customers

A career as a programmer Many people are employed as programmers They may create new programs for their boss They may maintain programs which are already written, debugging, modifying, updating, etc. Some people start their own companies to make the software they think will be useful or popular or profitable Some are self-employed contractors, hiring out to do programming jobs for different companies