by: GENEVEVE T. REBACA/REY C.
GEROLAGA
Learning Objectives:
• Discuss Programming Circle, Algorithm and
Pseudocode.
• Design Algorithm and Pseudocode that will solve
real-life problems.
Scrutinize a sample Birthday Program
I. Opening remarks - Juan Dela Cruz
II. Intermission Nmuber- Show Girls
III. Invocation - Richard Yee
IV. Message - John Doe
V. Singing of Birthday Song – Mass Singing
VI. Message
VII. Dinner
A software bug is an error, flaw, mistake, failure, or fault
in a computer program that prevents it from behaving as
intended (ex. producing an incorrect or unexpected
result). Most bugs arise from mistakes and errors made
by people in either a program's source code or its
design.
- These are grammatical errors in the formulation of
statements.
Syntax errors include such things as misspelled
commands and missing "."
- These are errors that cannot be detected until the program is
running. The syntax of the statements is correct, but on execution
they cause a situation to arise that results in a crash or an
undefined value.
- Examples of run-time errors are attempted division by zero or trying
to access a non-existent object.
- These are errors that cause the program to behave incorrectly. They
generally arise through failure on the part of the programmer to
arrive at a correct algorithm for the task.
Typical problems might be incorrect ordering of statements, failure to
initialise or re-initialise a variable, assignment to an incorrect
variable, use of ‘<’ instead of ‘<=’, use of ‘and’ instead of ‘or’, or
omission of a crucial step in the processing.
Example Algorithm
Problem: Design an algorithm that will add 2 numbers.
Algorithm:
1. Input 2 numbers
2. Add 2 numbers
3. Display output
Apply Algorithm
Problem: Design an algorithm that will compute the weekly salary of an
employee which is paid on an hourly rate.
Pseudocode
• is an English-like representation of the logical steps it takes to solve a
problem.
• Problem: Design an algorithm that will add 2 numbers.
start
input: num1, num2
process: myAnswer = num1 + num2
output myAnswer
stop
Apply Pseudocode
• Problem: Design an algorithm that will compute the weekly salary of
an employee which is paid on an hourly rate.
Exercises
• Instruction: Use Algorithm and Pseudocode in designing solution to a
given problem.
• Problem: Design a solution that will get the total price of 3 items,
compute the discount of items which is 5% (all items), compute the
change considering payment is provided.
Assignment
• Study on the parts of IDE of a Visual Studio.net