Vous êtes sur la page 1sur 23

CS002P

Week 1
Review of basic programming constructs

TOPIC
Recall different terminologies and concepts
involving the basic programming
constructs.

OBJECTIVE
 BUG – is a term used to refer for a
program mistake or error.
 C++ LIBRARY – provides a set of common
classes and interfaces that greatly extend
the core C++ language.
 COMPILER – is a program that converts
your program to low-level machine
instructions.
 DEBUG – is a process of correcting
program mistakes.

DEFINITION OF TERMS
4
 EDITOR – is software that enables the typing
of the programs where you can easily type,
change and save programs.
 IDENTIFIER – is a sequence of one or more
letters, digits or underscores characters (_).
 LINKER – is a program that supplies needed
runtime information to the compiled program
and it is also used to combine multiple
programs into one executable program.
 LOADER – is a program that loads an
executable program into main memory.

DEFINITION OF TERMS
5
 NAMESPACE – is an abstract container providing
context for the items (names, or technical terms,
or words) it holds and allowing disambiguation of
items having the same name.
 OBJECT CODE – is the code produced by a
compiler from the source code, usually in the form
of machine language that a computer can execute
directly.
 PREPROCESSOR – reads a program’s preprocessor
directives to control the compilation.
 PROGRAM – is a list of detailed instructions that
tells the computer what to do.

DEFINITION OF TERMS
6
 PROGRAMMING – is the act or process of
creating a program.
 SOURCE CODE – is code written by a
programmer in a high-level language and
readable by people but not computers.
 SYNTAX – is the rules governing the
formation of statements in a programming
language, usually a typing error.
 VARIABLE – is an example of an identifier, it
is a location where you can store a piece of
information.

DEFINITION OF TERMS
7
Review cout/formatting
Review cin
Review if statement
Review Switch Statement
Review of While Statement
Review of Do…While Statement
Review of For Loop with Break
Review of For…Loop with Continue
statement
LABORATORY
1. Write a program that determine if the
number is odd or even.

REVIEW EXERCISE – if.. else


2. Write a program that will display series
of asterisk depend on the user input.

Enter a number: 5
*****

*Use for, do while and while loop

REVIEW EXERCISE.. Loop


3. Write a program that will display the
equivalent word of a number value.
Value is 0 to 9 only. (Use switch
statement)

REVIEW EXERCISE
4. Write a program that will generate the
following output.

Enter row: 5
Enter column: 2

* *
* *
* *
* *
* *

REVIEW EXERCISE.. Nested Loop


5. Write a program that will display the
following output depend on a number
entered by the user.

Enter size of square: 5

@ @
@@@ @@
@ @
@@@ @@
@ @

REVIEW EXERCISE.. Decision loop


End

Vous aimerez peut-être aussi