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

BASTA

The document provides an overview of key terminologies related to computer programming, including algorithms, programming languages, and components of computers such as hardware and software. It outlines the process of computer programming, the program development life cycle, and various number systems and their conversions. Additionally, it discusses common programming languages and provides examples of coding in different languages.

Uploaded by

Ashly Leona
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)
15 views

BASTA

The document provides an overview of key terminologies related to computer programming, including algorithms, programming languages, and components of computers such as hardware and software. It outlines the process of computer programming, the program development life cycle, and various number systems and their conversions. Additionally, it discusses common programming languages and provides examples of coding in different languages.

Uploaded by

Ashly Leona
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/ 13

Reviewer for IT111

Terminologies and Their Meanings

• Algorithm: A set of instructions designed to solve a problem. Think of


it as a computer’s method of problem-solving.
• Array: A container that holds multiple variables, all of the same type, to
group similar data together.
• Binary Numbers: The system computers use to represent information
through sequences of 1s and 0s. These binary digits are interpreted as numbers,
letters, operators, and other data.
• Bit: The individual 1s and 0s in binary numbers.
• C++: A versatile programming language known for its low-level
capabilities and wide applicability.
• Coding: The process of using programming languages to instruct
computers on what actions to perform.
• Computer Program: A sequence of instructions executed by a
computer to accomplish a specific task.
• Conditional Statements: These evaluate to true or false and are used
to control the flow of the program based on certain conditions.
• If Statement: Executes a block of code if a specified condition is true.
• Else Statement: Provides an alternative block of code to execute if the
associated if condition is false.
• For Loops: A type of loop that executes a block of code a
predetermined number of times, as opposed to while loops which run until a
condition is no longer true.
• Function: A block of code that performs a specific task and can be
called by name from other parts of the program.
• Integrated Development Environment (IDE): Software that provides
tools to make coding easier, including text editing, debugging, and compiling
features.
• Java: A powerful, multi-platform programming language used in many
professional applications, including Android apps and operating systems.
• Python: A versatile and increasingly popular programming language,
known for its simplicity and extensive libraries.
• Variable: A storage location in a program that holds data values.
Variables are defined with a specific type such as:
• String: Holds words and phrases.
• Char: Represents a single character.
• Int: Stores whole numbers.
• Double/Float: Holds decimal numbers.
• Bool: Represents boolean values (true or false).
• While Loops: These loops run a block of code as long as a specified
condition remains true.
• Computer Programmer: An individual who writes and maintains
computer programs, often as a profession.

• Computer Programming: The process of giving computers instructions on


what actions to perform next.
• Programming Language: A formal language consisting of a set of
instructions used to produce various outputs and to implement algorithms in
computer programming.
• Software: The collection of programs and other operating information
used by a computer. Examples include the Operating System and Microsoft Office.
• Hardware: The physical components required for a computer system
to function. Examples include the motherboard, processor, and hard drive.
• Visual Studio Code: A lightweight code editor that supports various
development tasks such as debugging, task running, and version control.

What is Computer Programming and How to Become a Computer Programmer

• Computer programming is the process that professionals use to write code that
instructs how a computer, application or software program performs. Basically it is
a set of instructions to facilitate specific actions.
• Computer programmers create instructions for a computer to execute by writing
and testing code that enables applications and software programs to operate
successfully.

Introduction to Computer Programming

Objectives
1. Discuss the basic components of a computer (Both Software &Hardware).
2. Discuss brief overview of programming languages and the program development
life cycle.
3. Different number systems and conversions from one type to another will be
discussed.

Objectives
At the end of the lesson, the student should be able to:
• Identify the different components of a computer.
• Know about programming languages and their categories.
• Understand the program development life cycle and apply it in problem solving.
• Learn the different number systems and their conversions.
Introduction
• A computer is a machine that performs a variety of tasks according to specific
instructions.
• It is a data processing machine which accepts data via an input devices and its
processor manipulates the data according to a program.

Two Major component of computer


• Hardware
• Software - which is the intangible part of a computer. It consists of data and the
computer programs.

Hardware
•Hardware is which the tangible part of the computer. It is composed of electronic
and mechanical parts.

Example of Hardware
• The Central Processing Unit
• Memory
• Input and Output Devices

The Central Processing Unit (CPU)


• The processor is the “brain” of the computer.
• It contains millions of extremely tiny electrical parts.
• It does the fundamental computing within the system. • Examples of processors
are Pentium, Athlon & SPARC.

Memory
• The memory is where data and instructions needed by the CPU to do its appointed
tasks can be found.
• It is divided into several storage locations which have corresponding addresses.
• The CPU accesses the memory with the use of these addresses.

Two type of Memory


• Main Memory - is very closely connected to the processor. It is used to hold
programs and data, that the processor is actively working with. It is not used for
long-term storage. It is sometimes called the RAM (Random Access Memory). The
computer's main memory is considered as volatile storage. This means that once the
computer is turned off, all information residing in the main memory is erased

.
• The Secondary Memory - is connected to main memory. It is used to hold
programs and data for long term use. Examples of secondary memory are hard disks
and CD-ROM. Secondary memory is considered as non-volatile storage. This means
that information residing in secondary memory is not erased after the computer is
turned off.

Input and Output Devices


• Input Device - is any hardware device that sends data to a computer, allowing you
to interact with and control it.
Some examples of Input Device.
• Keyboard
• Mouse
• Scanner
• Microphone
• Bar code Reader
• Joy Stick
• Light Pen

Input and Output Devices


• Output Device - is any peripheral that receives data from a computer, usually for
display, projection, or physical reproduction.
Some examples of Output Devices:
• Monitor
• Printer
• Speaker / Headphone
• Projector

Software
• A software is the program that a computer uses in order to function. It is kept on
some hardware device like a hard disk, but it itself is intangible.
Some Types of Computer Programs:
• Systems Programs
• Application Programs
• Compilers
Some Types of Computer Programs:

•Systems Programs - Programs that are needed to keep all the hardware and
software systems running together smoothly.
• Example: Operating Systems like Linux, Windows, Unix, Solaris, MacOS
•Application Programs - Programs that people use to get their work done.
• Examples: Word Processor, Game Programs, Spreadsheets
•Compiler - The computer understands only one language (Machine Language).
Machine language is in the form of ones and zeros. Since it is highly impractical for
people to create programs out of zeros and ones, there must be a way of translating
or converting a language which we understand into machine language, for this
purpose, there exists compilers.

Example of Compiler
1. Java
2. Netbeans
3. Best C Compiler
4. C++

Overview of Computer Programming Languages

What is a Programming Language?


• It is a standardized communication technique for expressing instructions to a
computer.
• Like human languages, each language has its own syntax and grammar.
• There are different types of programming languages that can be used to create
programs, but regardless of what language you use, these instructions are translated
into machine language that can be understood by computers.
Question: What is the oldest Programming Language?

Answer: FORTRAN

Categories of Programming Languages

1. High-level Programming Languages - is a programming language that is more


user-friendly, to some extent platform-independent, and abstract from low-level
computer processor operations such as memory accesses. A programming
statement may be translated into one or several machine instructions by a compiler.
Example: Java, C, C++, Basic, Fortran.
Categories of Programming Languages

2. Low-level Assembly Language - Assembly languages are similar to machine


languages, but they are much easier to program in because they allow a
programmer to substitute names for numbers. Assembly languages are available for
each CPU family, and each assembly instruction is translated into one machine
instruction by an assembler program.

Note: The terms "high-level" and "low-level" are inherently relative.


Originally, assembly language was considered low-level and COBOL, C, etc.
were considered high-level. Many programmers today might refer to these
latter languages as low-level.

The Program Development Life Cycle


• Programmers do not sit down and start writing code right away when trying to
make a computer program.
Here are the basic steps in trying to solve a problem on the computer:
1. Problem Definition
2. Problem Analysis
3. Algorithm design and representation (Pseudocode or flowchart)
4. Coding and debugging

Question: Who is the First Programmer?


1. Problem Definition
• A programmer is usually given a task in the form of a problem.
• Before a program can be designed to solve a particular problem, the problem must
be well and clearly defined first in terms of its input and output requirements.
• A clearly defined problem is already half the solution. Computer programming
requires us to define the problem first before we even try to create a solution.
Let us now define our example problem:
“Create a program that will determine the number of times a name occurs in a list.”

2. Preoblem Analysis
• After the problem has been adequately defined, the simplest and yet the most
efficient and effective approach to solve the problem must be formulated.
• Usually, this step involves breaking up the problem into smaller and simpler
subproblems.
Example Problem:
Determine the number of times a name occurs in a list.
Input to the program:
list of names, name to look for.
Output of the program:
the number of times the name occurs in a list.

3. Algorithm design and representation


• Once our problem is clearly defined, we can now set to finding a solution. In
computer programming, it is normally required to express our solution in a step-by-
step manner.
• Now given the problem defined in the previous sections, how do we express our
general solution in such a way that it is simple yet understandable?

3. Algorithm design and representation


Expressing our solution through Human language:
1. Get the list of names
2. Get the name to look for, let's call this the keyname
3. Compare the keyname to each of the names in the list
4. If the keyname is the same with a name in the list, add 1 to the count 5. If all the
names have been compared, output the result

3. Algorithm design and representation


Expressing our solution through a flowchart:
3. Algorithm design and representation
Expressing our solution through a flowchart:

What is Flow chart & Pseudocode?


•Flow chart – It is a type of diagram that represents an algorithm, workflow or
process. It is shows the steps as boxes of various kinds, and their order by
connecting the boxes with arrows. Flowcharts are used in analyzing, designing,
documenting or managing a process or program in various fields.
• Pseudocode is an informal way of programming description that does not require
any strict programming language syntax or underlying technology considerations. It
is used for creating an outline or a rough draft of a program. It’s summarizes a
program's flow, but excludes underlying details.
4. Coding and Debugging
• After constructing the algorithm, it is now possible to create the source code. Using
the algorithm as basis, the source code can now be written using the chosen
programming language.
• Most of the time, after the programmer has written the program, the program isn't
100% working right away. The programmer has to add some fixes to the program in
case of errors (also called bugs) that occurs in the program. This process of is called
debugging.

two types of errors that a programmer will encounter along the way.
• compile-time error – occur if there is a syntax error in the code. The compiler
will detect the error and the program won't even compile. At this point, the
programmer is unable to form an executable that a user can run until the error is
fixed. Forgetting a semi-colon at the end of a statement or misspelling a certain
command, for example, is a compile-time error. It's something the compiler can
detect as an error.
• Compilers aren't perfect and so can't catch all errors at compile time. This is
especially true for logic errors such as infinite loops. This type of error is called
runtime error.

What is programming Language?


• is a set of commands, instructions, and other syntax use to create a software
program.
• Languages that programmers use to write code are called "high-level languages.“
• Examples of high-level languages include C++, Java, Perl, and PHP.

Example of Programming Language


Here are the most popular programming languages:
1. Java
2. Phyton
3. C Programming - is a general-purpose programming language that is extremely
popular, simple and flexible.
4. Ruby - (also known as Ruby on Rails) is a major supplier of web apps.
5. Java Script - allows developers to add interactive elements to their website, and
its presence is felt across the internet.
6. C# (it pronounced C-Sharp NOT C-hashtag)- Is the language used in order to
develop Microsoft apps. is syntactically nearly identical to Java.
7. PHP - is often used in conjunction with dynamic data-heavy websites and app
development.
8. Objective C - is the programming language behind iOS apps.
9. SQL (Structured Query Language) – It usually use for massive database STORAGE.
Some Example of Programming Language codes
How to code “HELLO WORLD” in different programming language

Java -
class A {
public static void main (String args[]){
System.out.println(“HELLO WORLD”); }
}

Phyton print(‘HELLO WORLD’)

C#
Class Program {
static void Main(string[] args) {
Console.Writeln(“HELLO WORLD”);
Console.Readkey(); }
}

PHP
<html> <Head>
<Title>PHP Hello World</title> </Head>
<body>
<?php
Echo “HELLO WORLD”; ?>
</body>
</html>

Java Script
<!doctype html> <Html>
<Head>
<Title>Hello World</title> </Head>
<body>
<script language = “Javascript”> alert (“Hello World”) </body>
</html>
Number System

Number Systems and Conversions


• Numbers can be represented in a variety of ways. The representation depends on
what is called the BASE. The following are the four most common representations.
• Decimal
• Binary
• Octal
• Hexadecimal

Decimal
• We normally represent numbers in their decimal form.
• Numbers in decimal form are in base 10. This means that the only digits that
appear are 0-9.
•Here are examples of numbers written in decimal form: 12610 (normally written
as just 126)
1110 (normally written as just 11)

Binary
• Numbers in binary form are in base 2. This means that the only legal digits are 0
and 1.
• We need to write the subscript 2 to indicate that the number is a binary number.
•Here are examples of numbers written in binary form: 11111102
10112

Octal
• Numbers in octal form are in base 8. This means that the only legal digits are 0-7.
• We need to write the subscript 8 to indicate that the number is an octal number.
•Here are examples of numbers written in octal form: 1768
138

Hexadecimal
• Numbers in hexadecimal form are in base 16. This means that the only legal digits
are 0- 9 and the letters A-F (or a-f, lowercase or uppercase does not matter).
• We need to write the subscript 16 to indicate that the number is a hexadecimal
number.
•Here are examples of numbers written in hexadecimal form:
7E16 B16
Conversions

Decimal to Binary / Binary to Decimal


• To convert a decimal number to binary, continuously divide the number by 2 and
get the remainder (which is either 0 or 1), and get that number as a digit of the
binary form of the number. Get the quotient and divide that number again by 2 and
repeat the whole process until the quotient reaches 0 or 1. We then get all the
remainders starting from the last remainder, and the result is the binary form of the
number.
NOTE: For the last digit which is already less than the divisor (which is 2) just copy
the value to the remainder portion.

Decimal to Binary / Binary to Decimal


• To convert a binary number to decimal, we multiply the binary digit to "2 raised to
the position of the binary number". We then add all the products to get the resulting
decimal number.

You might also like