06_Programming_Concepts[1] - CSI1306F LECTURE6...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CSI 1306 F “Computing Concepts for Business” LECTURE 6: “HIGH-LEVEL PROGRAMMING CONCEPTS”
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Computer Programming Computers assist humans in performing complicated tasks  far beyond our capabilities. How do they work? By strictly following a predefined set of instructions  coming from the user. The set of instructions is known as  algorithm When written in a language that the computer can  understand, the algorithm becomes a computer program   (also  source code ). Programmers (a.k.a. software developers) write the  programs that the computer will execute later.
Background image of page 2
Computer Programming Often shortened  to  programming  or  coding . It is the process of writing , testing , troubleshooting   and maintaining  the source code of computer  programs. Computer programs are often written in high-level  programming languages : e.g. Java, C, C++, Python, MATLAB, Delphi, Visual Basic,  Eiffel, etc. High-level programs will have to be later  compiled/interpreted to generate machine language  code.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Computer Programming Every programming language has a  set of rules  that users  must comply with in order to write correct programs. Regardless of which programming language is used for  writing a source program, some basic concepts are shared  among all: Variables Constants Data Types Flow Control Conditional Branches Repetitive Loops
Background image of page 4
Variables variable  is an identifier (e.g. Age, Person1, HighestMark)  that we use in a computer program to store a datum.  Values  can change. Each variable represents one or more contiguous cells in the  computer’s memory where the datum is physically stored. Variables belong to different  data types . While the program is running, the value of any variable may  be modified. The variable’s name is decided by the programmer but must  respect the programming language’s rules.  Always give variables meaningful names, e.g. LowestPrice  instead of LP.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Variables Variables can be categorized into global  or local . global variable  is visible (i.e. can be accessed) from everywhere in the  program. local variable  can only be accessed from within specific segments of the  program.  Variables participate in multiple types of instructions: Assignment: Age = 20 Arithmetic: Counter++ Logic: (Age > 20) AND (Province = ‘Ontario’) Loops: Do Until (Answer = ‘N’)
Background image of page 6
Constants Constants  are really just a way of assigning a name to a value. For example, PI = 3.14159
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/01/2010 for the course COMPUTER S CSI1306 taught by Professor Aziri during the Spring '10 term at University of Ottawa.

Page1 / 26

06_Programming_Concepts[1] - CSI1306F LECTURE6...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online