0% found this document useful (0 votes)
26 views7 pages

Ict 1ST QTR

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views7 pages

Ict 1ST QTR

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

st  Manage files

ICT 10 – 1 qtr Categories of Computers:


Computer - is an electronic device, operating under  Desktop/Personal Computers
the control of instruction stored in its memory, that
 Mobile Computers (Laptops)
can accept data (input), process the data according to
 Mobile Devices (Tablets, Smartphones, Portable
specified rules, produce information (output), and
Media Player, Digital Camera)
store the information for future use.
 Game Consoles
Data - collection of raw facts and figures. It may  Servers - A server controls access to the hardware,
consist of numbers, characters, symbols, or pictures. software, and other resources on a network.
 Mainframe - Mainframes are a type of computer
Information - processed data. It is more meaningful
that generally are known for their large size,
than data.
amount [storage, processing power, and high level
Advantages of Using Computers: of reliability. They are primarily used by large
organizations for mission-critical applications
1. Speed requiring high volumes of data processing.
2. Reliability  Supercomputer - A supercomputer is the fastest,
3. Consistency most powerful computer. Fastest supercomputers
4. Storage are capable of processing more than one
5. Communications quadrillion instructions in a single second!

Disadvantages of Using Computers:

1. Health Risks
2. Violation of Privacy
3. Public Safety
4. Impact on Labor Force
5. Impact on the Environment

Software - is a collection of data/computer


instructions that tell the computer how to work

The software can be categorized as:

1. Application Software. - Used for personal


productivity/to perform specific tasks, examples are
Microsoft Word and Adobe Photoshop

2. System Software - helps the computer perform


essential operating tasks and enable application
software to run, examples are Operating System,
Device drivers, and Utility Programs)

3. Operating System - Set of programs that control


computer hardware and acts as an interface with
application programs Examples are Windows, Mac,
and Android

Activities performed by the OS:


 Perform common computer hardware functions
 Provide a user interface and input/output
management
 Provide a degree of hardware independence
Manage svstem memory
 Provide networking capability
 Control access to system resources
System Unit  The processor contains registers, that temporarily
hold data and instructions
 is a case that contains electronic components of
the computer used to process data
Access time is the amount of time it takes the
 Other names for the system unit include the
computer chassis, cabinet, box, tower, enclosure, processor to read from memory. Measured in
housing or simply case Nanoseconds A Bit is a unit of measure that
represents the 0/the 1, electronically by the
Components of the System Unit: presence/absence of an electrical charge.
1. Motherboard • Eight bits grouped as a unit are called a Byte. A byte
2. Drives represents a single character in the Computer
3. Power Supply
4. Sound Card Меmогу - Memory consists of electronic components
5. Video Card that store instructions waiting to be executed by the
6. Processor processor, data needed by those instructions, and the
7. Memory results of processing the data.

The Motherboard - The motherboard is also known as Memory can be


the system board/main board and is the main circuit  Volatile - loses its contents when the power is
board of the microcomputer. turned off. An example includes RAM (Random
 It is a big connecting platform fixed to the bottom Access Memory)
of the system unit and has a variety of chips and  Non Volatile - does not lose its contents when
other smaller boards attached to it. The power is turned off. An example includes ROM
motherboard is sometimes referred to as the (Read Only Memory)
spine of the computer because all devices used on Memory size is measured in kilobytes (KB/K),
the computer need to be connected in one megabytes (MB) qigabytes (GB), or terabytes (TB)
way/another to the motherboard.
Power Supply Unit - The power supply unit converts Drives - A drive is a location (medium) that is capable
alternating current (AC) from the main supply to the of storing and reading information that is not easily
different direct current (DC) voltages required by the removed, like a disk/disc. All drives store files and
various components of the computer. It is responsible programs that are used by your computer.
for all the power coming into the computer and
maintains the right voltage. Expansion Slots and Adapter Cards
• An expansion slot is a socket on the motherboard
Processor - The processor, also called the central that can hold an adapter card
processing unit (CPU), is the main processing device in • An adapter card enhances functions of a component
the computer system that cares out the instructions of of the system unit and/or provides connectioris, to
a computer program. It is responsible for performing peripherals (ex: sound card, video card)
the basic arithmetic, logical, and input/output
operations of the computer. The CPU is usually Ports and Connectors
attached to a heat sink and a cooling fan. The heat • A port is a point at which a peripheral attaches
sink absorbs heat from the CPU and the fan blows the to/communicates with a system unit (sometimes
heat away referred to as jack)
Components of the Processor: • A connector joins a cable to a port
 The control unit is the component of the
processor that directs and coordinates most of the
operations in the computer
 The arithmetic logic unit (ALU) performs
arithmetic, comparison, and other operations
Computer system - Combination of all the A program with syntax errors cannot execute. A
components required to process and store data using program with no syntax errors can execute, but might
a computer contain logical errors, and produce incorrect output as
a result.
Hardware - Equipment associated with a computer
Software - Computer instructions For a program to work properly, you must give the
 Tell the hardware what to do instructions to the computer in a specific sequence,
 Programs you must not leave any instructions out, and you must
 Instructions written by programmers not add extraneous instructions. By doing this, you are
developing the logic of the computer program.
Computer hardware and software accomplish three
major operations

 Input
 Data items enter computer
 Processing
 By central processing unit (CPU)
 Output

Computer programming language, any software used


for communicating a set of detailed instructions to a
computer. These instructions can be executed directly
when they are in the computer language numerical
form known as machine language, after a simple
substitution process when expressed in a
corresponding assembly language,/after translation
from some "higher-level" language.

The instructions you write using a programming


language are called program code; when you write
instructions, you are coding the program.

Every programming language has rules governing its


word usage and punctuation. These rules are called
the language's syntax. Unless the syntax is perfect, the
computer cannot interpret the programming language
instruction at all.

When you type program instructions, they are stored


in computer memory, which is a computer's
temporary, internal storage. RAM/random access
memory is an example of internal storage which is also
volatile type of memory.

After a computer program is typed using programming


language statements and stored in memory, it must be
translated to machine language by the
compiler/interpreter.
Program Development Process
1. Understand the problem
2. Plan the logic
3. Code the program
4. Use software (a compiler/interpreter) to translate
the program into machine language
5. Test the program
6. Put the program into production
7. Maintain the program

Understanding the Problem


 One of the most difficult aspects of programming
 Users/end users - People for whom program is
written
 Documentation - Supporting paperwork for a
program

Planning the Logic


 Heart of the programming process
 Most common planning tools - (Flowcharts &
Pseudocode)
 Desk-checking - Walking through a program's logic
on paper before you actually write the program
Coding the Program
 Hundreds of programming languages are available
Choose based on features
Alike in their basic capabilities
 Easier than planning step
Translate the Program into Machine Language
 Translator program - Compiler/interpreter -
Changes the programmer's English-like high-
level programming language into the low-level
machine language
 Syntax error - Misuse of a language's grammar
rules
 Programmer corrects listed syntax
errors
 Might need to recompile the code
several times
Testing the Program
 Logical error - Use a syntactically correct
statement but use the wrong one for the current
context
 Test - Execute the program with some sample data
to see whether the results are logically correct
 Programs should be tested with many sets of data
Pseudocode is an English-like representation of the BASICS OF A TYPICAL C++ ENVIRONMENT
logical steps it takes to solve a problem. It is also a
Phases of C++ Programs
detailed yet readable description of what a computer
program must do, expressed in a formally-styled 1. Edit – Program created in the editor and stored
natural language rather than in a programming on disk.
language. Pseudocode is sometimes used as a 2. Preprocess - Preprocessor program
detailed step in the process of developing a program. processes the code.
3. Compile - Compiler creates
Flowchart is a graphical representation of steps. It
object code and stores
shows steps in sequential order and is widely used in
it on disk.
presenting the flow of algorithms, workflow or
4. Link - Linker links the object code with the
processes. Typically, a flowchart shows the steps as
libraries, creates a out and stores it on disk
boxes of various kinds, and their order by connecting
5. Load - Loader puts program in memory
them with arrows.
6. Execute - CPU takes each instruction and
executes it, possibly storing new data values
as the program executes.
A terminal symbol, or start/stop symbol, should be
included at each end. Often, "start" or "begin" is used
as the first terminal symbol and "end" or "stop" is used
History of C++:
in the other. The standard terminal symbol is shaped
like a lozenge. 1979: Bjarne Stroustrup works on “C with Classes”,
wanting to add object-oriented programming
You use a parallelogram to represent an input symbol,
into the C language
which indicates an input operation. You write an input
statement in English inside the parallelogram 1983: name changed from C with Classes to C++
Arithmetic operation statements are examples of 1985: C++ implemented as a commercial product,
processing. In a flowchart, you use a rectangle as the not officially standardized yet
processing symbol that contains a processing
statement. 1990: Turbo C++ released as commercial product

1998: C++ standards committee published the first


international standard for C++
Variables are memory locations; whose contents can
vary or differ over time. Referring to our Figure 1 2011: new C++ standard (C++11) finished in
above, sometimes, myNumber can hold a 2 and mid-2011
myAnswer will hold a 4; at other times, myNumber can
Compilers:
hold a 6 and myAnswer will hold a 12. A variable name
is also called an identifier. Variable names used here Cfront – first C with Classes compiler, derived from
follow only two rules:
Cpre – a C compiler
1. Must be one word

2. Have some appropriate meaning

A preselected value that stops the execution of a


program is often called a dummy value because it
does not represent real data, but just a signal to stop.
Sometimes, such a value is called a sentinel value
because it represents an entry or exit point, like a
sentinel who guards a fortress. Many programming
languages use the term eof (for "end of file") to refer to
this marker that automatically acts as a sentinel.
Template: comments
Written between / and / or following a //
Improve program readability and do not cause the
//this is the c++ template computer to perform any action.

preprocessor directive
#include<iostream>
Message to the C++ preprocessor. Lines beginning with # are preprocessor directives.
#include <iostream> tells the preprocessor to include the contents of the file <iostream>,
which includes input/output operations (such as printing to the screen)-

using namespace std; A namespace is used as additional information to differentiate similar functions, classes,
variables etc. with the same name available in different libraries. Using namespace, you
can define the context in which names are defined. (std = standard)

int main() C++ programs contain one or more functions, one of which must be main Parenthesis
are used to indicate a function. int means that main "returns" an integer value.

{
cout << "Hello world!"; Prints the string of characters contained between the quotation marks. The entire line,
including cout, the << operator, the string "Hello World" and the semicolon (;), is called a
statement. All statements must end with a semicolon.

return 0; Return is a way to exit a function from a function. return 0 (zero), in this case, means that
} the program terminated normally.

Escape Sequences:
Variables are used to store information to be later
Escape Sequence Explanation
manipulated in a computer program. Variables also
\n Creates a new line or offer a way of labeling data with a descriptive name;
line break. the programs can be appreciated more clearly by the
\t Inserts a horizontal tab reader. Variables are containers that hold information.
or spacing. The purpose is to label and store data in memory. This
\r Carriage return: Moves data can then be used throughout your program.
the cursor to the
beginning of the line. Fundamental data types
\a Alert. Sound the system
bell. The values of variables are stored somewhere in an
\ Represents a backslash unspecified location in the computer memory as zeros
character. and ones. Our program does not need to know the
" Represents a double exact location where a variable is stored; it can simply
quote character. refer to it by its name. What the program needs to be
aware of is the kind of data stored in the variable. It's
not the same to store a simple integer as it is to store a
letter or a large floating-point number; even though
they are all represented using zeros and ones, they
are not interpreted in the same way, and in many
cases, they don't occupy the same amount of memory.

Fundamental data types are basic types implemented


directly by the language that represent the basic
storage units supported natively by most systems.
They can mainly be classified into:

 int - stores integers (whole numbers), without


decimals, such as 123 or -123
 float - stores floating point numbers, with
decimals, such as 19.99 or -19.99
 char - stores single characters, such as 'a' or IF, ELSE IF, ELSE
'B'. Char values are surrounded by single
if (condition) fulfills one
quotes
 string - stores text, such as "Hello World". {statement} condition
String values are surrounded by double quotes
 bool - stores values with two states: true or else if (condition) fulfills 2nd condition
false {statement} when 1st is false
 Declaring a variable is done by specifying
its data type followed by the variable else | also known as switch statement fulfills 3rd condition
name. if neither 1st nor
{statement}
 Ex. float firstNumber, secondNumber; 2nd are true

Note:

 The value stored in a variable can be changed


during program execution. Logical Expressions:
 A variable is only a name given to a memory
 All conditional statements in C++ make use of
location; all the operations done on the
logical expressions that are true/false
variable effects that memory location.
statements about data
 In C++, all the variables must be declared
 Simple logical expressions are of the form:
before use.
(data operator data)
 Data terms in logical expressions can be
variables, constants or arithmetic expressions
 C++ evaluates logical expressions from left to
right to see if they are true/false

The C++ relational operators are:

< less than

> greater than

<= less than or equal to

>= greater than or equal to

== equal to

!= not equal to

CONDITIONAL STATEMENTS:

You might also like