0% found this document useful (0 votes)
6 views

Chapter 1 (A)

cs

Uploaded by

nikzamzuri225
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Chapter 1 (A)

cs

Uploaded by

nikzamzuri225
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Intro to computer programs, programming, and programming languages

Why learn to write computer programs?

Compilers and interpreters

Standard data types

Identifiers

Program development life cycle


Program: A set of instructions that the computer needs to follow to process the data into
information.

Computer program: A sequence of instructions that the computer carries out to fulfill the
task.

Computer programmer: A person who writes a computer program.

Computer programming: The act of designing and implementing computer programs


using the programming languages.

Programming language: Provides a way to program a computer using instructions that can
be understood by computers and human. It has its own vocabulary and rules of usage.
Easy to express tasks from a particular problem domain.

Allow user to instruct computer to do a specific task in a certain instances (or data).

A skill required for a computer scientist and software engineer.

A skill required to create a successful computer program.


COMPILER

•A program that translates high-level language (e.g.: FORTRAN,


PASCAL, COBOL, C++ and Java) into machine language.
•Translate the source code once and saves to be reused.
•Requires less memory and runs faster.
INTERPRETER

•A program that translates source code of high-level language (e.g.:


BASIC, Python, Ruby) into machine language.
•Each instruction is interpreted into machine language
(1 statement at a time)
•Program is easier to develop.
• int
NUMERIC • double
• float
CATEGORIES OF
DATA TYPES
• char
TEXT/
SYMBOL • string
• bool
Variable: memory locations, whose contents can vary over time

Constant: memory locations, whose contents are not allowed to


change during program execution

Function: A program segment that can do specific tasks.


RULE 1
• May contain letters, numbers and underscore ( _ ).

RULE 2
• Must begin with a letter or underscore ( _ ). It may NOT begin with a
number.
RULE 3
• May NOT contain blanks / spaces

RULE 4
• May NOT be special characters / reserved words / symbols.
• Eg: $, %, &, *, @, etc.
Analyze Analyze problem and its solution requirements.

Design an algorithm (step-by-step problem-solving process in


Design
which a solution is arrived at in a finite amount of time).

Implement Implement the algorithm in a programming language (coding).

Verify Verify that the algorithm works (system test by compiler).

Maintain and Maintain and document the program by using and modifying it if
document the problem domain changes.

You might also like