Fundamentals of Programming Reviewer
Fundamentals of Programming Reviewer
Algorithm
✓ Precise step by step process that terminates after a finite of number of
algorithm problem got solved in the end
✓ Recipe for solving problems
✓ Finite set of instruction
Properties of an Algorithm
➢ Finiteness – there’s an exact number of steps that must be taken and it
has an end
➢ Absence of Ambiguity – Clear and precise instruction specification
➢ Sequence of Execution – Top to bottom approach
➢ Input & Output – The intake and the expected outcome
➢ Effectiveness – The solution is guaranteed to give a correct answer
➢ Scope Definition – Applies to a specific problem or class of problem
Pseudocode
• One statement per line
• Capitalize Initial Keyword
• Indention will show hierarchy and structures
• End multi-line structures
• Keep statements LANGUAGE independent
Fundamentals in Programming Laboratory Reviewer
Flowchart V Pseudocode
Flowchart is the first and well-known design tool that is being widely used
by programmers, the down thing is, it doesn’t reflect some concepts of a
structured programming very well. Pseudocode, on the other hand, is a newer
toll and has the features that makes it more reflective of the structured concepts.
The drawback is that the narrative presentation is not as easy to understand
and/or follow. This just shows the difference of these two. They are both useful
when it comes to programming, but also has some of its drawbacks.
Flowchart Advantages
➢ Standardized
➢ Visual
Flowchart Disadvantages
➢ Hard to modify
➢ Structured design elements not implemented
➢ Special Software Required
Pseudocode Advantages
➢ Easily Modified
➢ Implements structured concepts
➢ Done easily on word processor
Pseudocode Disadvantages
➢ Not visual
➢ No accepted standard, varies from company to company
Fundamentals in Programming Laboratory Reviewer
Before jumping in the actual flowcharting and Algorithm, here are the
FLOWCHART SYMBOLS that may help for an effective flowchart.
The preparation or
INITIALIZATION initialization of memory
space for data processing.
Manipulation of data
PROCESS (assignments and
mathematical
computations)
Amount <
100 FLOWCHART
PSEUDOCODE
IF amount < 100
interestRate = 0.6
ELSE
interestRate = .10
ENDIF
LOOPING STRUCTURE
Examples:
Pseudocode:
Source Code:
#include <stdio.h>
#include <stdlib.h>
if (aveGrade < 50 ){
printf ("\nWhat a Failure");
}
else
return 0;
}
Fundamentals in Programming Lecture
Electronic Data Processing / EDP -
• Process of collecting data and processing them to produce meaningful info’s by
using computer processing software and standard databases tools. It uses the
latest technique for processing large chunks of data. They use software.
• Digitalize transaction records on where it is stored on hardware(?). It is a
reliable, fast, and efficient technique, the Sigma Chad.
• EDP (electronic data processing) is a well-known term on the olden days of
earth. Now, we use the terms IS (Information Services) or MIS (Management
Information Services or Systems).
Advantages of EDP -
• Speed
• Information can be pulled easily for it is stored somewhere you can
access easily.
• Efficiency
• Easy and quick generation of the following documents and
materials.
• Economic
• Less overtime and reduced data managing cost.
• Reduced Labor
• No work and easy going
• Automatic Operation
• Unlike the manual doing stuffs, this automatically works and stores
the things on and by the computer program.
• Decision Making Capability
• Can decide on a certain decision instruction automatically. Here
are the two steps.
▪ Determines whether it is true or false
▪ Chooses a course of action on one of the alternatives that is
in the program.
• Compact Storage
• Just large storage size
• Accuracy
• That’s already in there. Accurate.
Disadvantages of EDP -
• Computer related failures. I.e., Powah failure, viruses, hackers, anything that
will mess your computers from the inside
• Basically, must follow the concept of GIGO (Garbage In, Garbage Out)
• Human Error
• Comp Security
Classification of Software
• System Software - The Operating System, Compiler, and Utility Programs.
• Application Software - The apps.
Application Software Categories
• Business Software: Financial Software, Accounting Software, etc.
• Graphic & Multimedia: VLC, AutoCAD, Photoshop
• Home/Personal/Education: MS Teams, Computer Games, Microsoft Office
• Communication: Zoom, Messenger, Skype
Application Types Categories
• Proprietary - software that their source codes can’t be dabbled/accessed by
anyone. It is protected by legal rights law to avoid such acts of nastiness i.e.,
piracy.
• In-House - Being developed by own company resources.
• Off-the-Shelf - can be bought and is being mass produced in the market. That’s
it, no need for you to do anything other than search that certain software that
has what you are looking for. Then buy it. That’s it.
• Customized - Software that the user really wants. Commonly being programmed
by In-House programmers.
Forms of Application Software
• Packaged Software: (You know Microsoft Teams, Words, PowerPoint, Excel,
etc... Yes, that's what it is, they came in a package.)
• Customized Software: (Can be modified by the developers with the request of the
user.)
• Web Application: (Runs on Websites)
• Open Source: (Can be modified by anyone.)
• Shareware: (Distributed for free trial basis)
• Freeware: (Offered at no cost)
• Public Domain Software: (No copyrights, a public one, yeah yeah.)
• High Level Languages - These are what you call programming languages, I.e., C,
C++, Pascal, HTML, etc.… These are the things that our lovely prof will discuss
with us. And it is also what every programmer uses.
• Fourth Generation Languages/ 4GL’s - Object Oriented Programming, Visual
Basic, Java, can be considered as 4GL’s. JARVIS from the movie Iron Man is
considered as a 4GL as well.
Program Development Process
• Process of expressing a fully detailed algorithm on a High-Level Programming
language.
• Note: Algorithm = Pseudocode
• Problem Solving Phase
• Problem Definition
• General Solution
• Simulation/Desk Checking
• Implementation Page
• Specific Solution
• Run/Debug
• Maintenance
C LANGUAGE:
HISTORY - was created by Dennis Ritchie at the Bell Telephone Laboratories in 1972.
Different versions of C started to come out and subtle differences between
implementations started to cause programmers headaches. In response to this problem,
the American National Standards Institute (ANSI) formed a committee in 1983 to
establish a standard definition of C, which became known as ANSI Standard C. With
few exceptions, every modern C compiler has the ability to adhere to this standard. The
C language was named “C language” because its predecessor was called B. the B
language was developed by Ken Thompson of Bell Labs.
WHY USE C?
• C is a powerful and flexible language: C is used for diverse projects (E.g., operating
systems, Word processors, graphics, spreadsheets, and even compilers for other
languages.)
• It’s a popular language preferred by professional programmers: As a result, a
wide variety of C compilers and helpful accessories are available.
• C is a portable language: Portable means that a C program written for one computer
system can be compiled and run on another system with little or no modification.
• C language of few words, containing only a handful of terms, called keywords:
this serves as the base on which the language's functionality is built. As you program
with C, you will find that it can be programmed to do any task.
• C is structured language: the distinguish feature of a structured language is
compartmentalization of code and data. This is the ability of a language to section off
and hide from the rest of the program all information and instructions necessary to
perform a specific task.
• C is modular: C code can (and should) be written in routines called function. By
passing pieces of information to the functions, you can create useful, reusable code.
ALGORITHM
An algorithm is a sequence of instructions that tells how to solve a particular problem.
An algorithm must be specified exactly, so there can be no doubt about what to do next,
and it must have a finite number of steps.
PROPERTIES OF AN ALGORITHM:
• Finiteness: there is an exact number of steps and has an end.
• Absence of ambiguity: every instructions is clearly specified.
• Sequence of execution: instructions are performed from top to bottom.
• Input and output: unknowns of the problem are specified and with expected
outcome.
• Effectiveness: the prescribed solution is guaranteed to give the correct answers
and the specified process is faithfully carried out.
• Scope definition: only applies to a specific problem.
STEPS IN PROGRAM DEVELOPMENT:
1. State the problem clearly.
2. Plan and write the logical order of instructions.
3. Code the program.
4. Enter the program into the computer.
5. Run and debug the program.
FLOWCHART:
A graphic representation of an algorithm, often used in the design phase of
programming to work out the logical flow of a program.
FLOWCHARTING GUIDELINES:
• The flowchart should flow from top to bottom
• If the chart becomes complex, utilize connecting blocks
• Avoid intersecting flowlines
• Use meaningful description in the symbol
PSEUDOCODE:
An outline of program, written in a form that can easily be converted into real
programming statements. Pseudocode cannot be compiled nor executed, and there are
no real formatting or syntax rules. It is simply one step - an important one - in producing
the final code. The benefit of pseudocode is that it enables the programmer to
concentrate on the algorithms without worrying about all the syntactic details of a
particular programming language. In fact, you can write pseudocode without even
knowing what programming language you will use for the final implementation.
PSEUDOCODING GUIDELINES:
• Write only one statement per line.
• Capitalize initial keyword.
• Indent to show hierarchy and structures.
• End multi-line structures.
• Keep statements language independent.
DISSECTING C PROGRAM
RELATIONAL OPERATORS:
C's relation operators are used to compare expression, and asking questions.
THE PRECEDENCE OF RELATIONAL OPERATORS:
the relational operators each have precedence that determines the order in which they
performed in a multiple operator expression. Similarly, you can use parenthesis to
modify precedence in expressions that use relational operators.
LOGICAL OPERATORS
C's logical operators let you combine two or more relational expressions into a single
expression that evaluates to either true or false.