Computer Fundamentals and Programming Reviewer
Computer Fundamentals and Programming Reviewer
COMPUTER PROGRAMMING
Computers can understand only these on Procedure-oriented programs include
and off switches
- COBOL (Common Business
first programmers had to write a program Oriented Language)
instruction using combinations of 0s and 1s;
- BASIC (Beginner’s All-Purpose
example: (00101 10001 10000) Symbolic Instruction Code)
Machine Language or Machine Code – - and C.
instructions written in 0s and 1s
Object-oriented programming (OOP)
LOW LEVEL LANGUAGES (Low Level
- More advance high-level languages
Programming Language)
can be used to create of object-
- very close to the machine’s native oriented programs
language (binary code).
- requires the programmers to focus on
- provide direct access to the
the objects that the program can use
computer’s hardware, such as
to accomplish its goal
registers and memory locations.
Ex. Machine language (binary - The ability to use an object for more
code) than one purpose enables code-reuse
Assembly Language – (requires an
- Follows a bottom-up approach
assembler to translate it into machine
code - Emphasizes encapsulation,
inheritance, and polymorphism
HIGH LEVEL LANGUAGES (High
Level Programming Language) Ex. Languages like Java, C++, and
Python.
more abstract and closer to human
language. Structured Programming is a great for
hide the details of the underlying simpler, smaller programs
hardware, making programming
Object-Oriented Programming is ideal for
easier.
larger, more complex systems
Ex. (Python, Java, C++, JavaScript, C#)
C++
Programming Paradigms - way to classify
A cross-platform language that can
programming languages based on their
be used to create high-performance
features
applications.
Twp types of Programming Paradigm 1979 C++ was developed by Bjarne
Stroustrup, as an extension to the C
1. Structured Programming
language.
2. Objected Oriented Programming C++ gives programmers a high level
of control over system resources and
memory.
Structured Programming C++ support classes and objects,
while C does not.
aimed to improving the
clarity, quality, and
development time of a
computer program
“spaghetti code” - difficult to
both follow and to maintain
APPLICATIONS OF C++
Follows a top-down approach
PROGRAMMING
1. Emphasizes the logical flow of the
program Application Software Development
Ex. Languages like C, Pascal, and
ALGOL.
- used in developing almost all the Program development process
major Operating Systems like - systematic of creating and
Windows, Mac OSX, and Linux. maintaining software applications
Programming Languages - involves series of phases, often
Development referred to as the Programming
- used extensively in developing new Development Life Cycle (PDLC)
programming languages
Computation Programming
- best friend of scientist because of STEPS IN PDLC
fast speed and computational
1. Analyze the Problem – you cannot
efficiencies.
solve a problem unless you
Games Development
understand it
- extremely fast which allows
OUTPUT – goal of solving
programmers to do procedural
the problem
programming
INPUT – items needed to
Embedded System
achieve the goal
- heavily used in developing Medical
Define the Problem – identify the
and Engineering Applications
business need or problem that the
IDE (Integrated Development software will address
Environment) Conduct Feasibility Study – assess
the technical, economic and
- is used to edit AND compile the
operational feasibility of the project
code.
Popular IDE’s include Code:
2. Design the Algorithm – plan the
Blocks, Eclipse, and Visual Studio.
algorithm that will transform the
problem input into its output
# include <iostream>
Algorithm – a step-by-step
using namespace std;
instruction to accomplish a
task
int main () {
- an English like way of
cout << “Hello World!”
writing and
return 0;
expressing a solution
}
to a problem
- helps construct the
C++ Syntax actual program easily
and clearly
#include <iostream> is a header file
Pseudocode – short English
library that lets us work with input
statement
and output objects
- means false code
using namespace std means that we
- cannot be understood
can use names for objects and
by the computer
variables from the standard library.
Flowchart – uses
int main() - called a function. Any
standardized symbols to
code inside its curly brackets {} will
visually depict an algorithm
be executed.
- Shows a logical
cout (pronounced “see-out” is an sequence of
object used together with the instructions which a
insertion operator (<<) computer has to
Every C++ statement ends with follow
semicolon ; Flowline – lines that connect
Return 0 ends the main function. different symbols that the
flowchart contains
PROGRAM DEVELOPMENT PROCESS
OVAL – start/ end
ARROW – shows the connection between Typos – simple mistakes in typing
the representative shapes Missing or extra characters –
forgetting necessary characters
PARALLELOGRAM – input/ output
Incorrect capitalizations – using
RECTANGLE - process wrong case
Mismatch symbols - using wrong
DIAMOND – decision
symbol
BENEFITS OF FLOWCHART
5. Maintain and Update the Program
Clarity – provides a clear
- Software project is
and concise visual
almost complete, the
representation
different phases
Understanding – understand
become
the sequence of steps and
documentation for
relationships
others
Problem solving – used to
Maintaining and Updating –
identify the inefficiencies and
ensuring the program remains
bottlenecks
functional, relevant and meets
Communication – effective
evolving users need
tools for communicating the
process
C++ Expression – an operator and
any of its operands taken together to
3. Implement the Algorithm – desk-
constitute an operation
check the algorithm before
implementing it
An expression is any word or group
Desk-check – facts that the
of words or symbols that is a value
programmers review the
algorithm
Arithmetic expression – contains
4. Test and Verify the Program – to
arithmetic operators, gives a numeric
evaluate and verify the program by
interpretation to the operands
entering your C++ instruction into
String expression - contains string
the computer
operators, gives a string
Testing and verification –
interpretation to the operands
crucial step in the software
Logical expression - contains
development process to
rational and logical operators, gives a
ensure that the program
logical interpretation to the operands
functions correctly
TRUE (1) or FALSE (0)
Debugging – process of
locating and correcting bug ARITHMETIC OPERATORS
Syntax error – occurs when
(+ add) (- subtract) (* multiply) (/ divide)
you break some of the
programming language rules (% modulus/remainder) (++ increment
Logical error – occurs from operator) (-- decrement operator)
a variety of reasons such as,
forgetting to enter
instructions Relational Operators – used for comparing
- Occurs as a result of two or more numerical values
calculation statements
- Used for decision
that are correct
making process
syntactically but
incorrect == checks if the value are equal or not
mathematically (is equal to)
COMMON CAUSES OF SYNTAX != check if the values of the operands are
ERRORS equal or not equal (not equal to)
( > ) greater than float myFloatNum = 5.9
( < ) less than char myLetter = ‘D’ ;
>= greater the or equal boolean myBool = true;
<= less than or equal string myText = “Hello”
- BERNA Biiiii ( ;
TYPE KEYWORD
Boolean bool
Character char
Integer Int
Floating point float
Double floating double
point
Value less void
Wide character wchar_t
int myNum = 5;