COS120 LECTURE 1 - COS120 Chapter 1 A computer program is a...

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

View Full Document Right Arrow Icon
COS120 Chapter 1 A computer program is a list of instructions written in a programming language to be executed by a computer. semantics meaning of the words syntax correct way to combine words How are semantics and syntax illustrated in the English sentence below? The brown dog barks. --> Each word has a meaning (ex. dog) and the sentence is constructed with correct English grammar. How are semantics and syntax illustrated in the VB statement below? If salary > 0.00 Then lblOutput.Text = FormatCurrency ( salary ) End If --> Each VB word has a meaning (ex. If ) and used correct VB syntax (ex. use > for greater than). Characteristics of Programming Languages vs. Natural Languages: small set of words each word has only one meaning the syntax is very strict Types of Programming Languages: Machine language: W ords are bitstrings (0s and 1s) Words map to basic operations like add or fetch Each computer has its own machine language High-level languages: Words look like English Each statement combines many machine instructions C, C++, Java, Fortran, COBOL, Visual Basic
Background image of page 1

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

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

Page1 / 3

COS120 LECTURE 1 - COS120 Chapter 1 A computer program is a...

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

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