Comprog Reviewer
Comprog Reviewer
Data Processing – the manipulation of data into a more Computer is used in business organizations for:
useful form
• Payroll calculations
Information - are processed data
• Budgeting
• Maintenance of stocks
Banking
• The computer provides a tool in the education system One of the major areas is CAD (Computer Aided Design)
known as CBE (Computer Based Education). that provides creation and modification of images.
Some of the fields are:
• CBE involves control, delivery, and evaluation of
learning. •Structural Engineering - Requires stress and strain
analysis for design of ships, buildings, budgets,
• Computer education is rapidly increasing the graph of
airplanes, etc.
number of computer students.
•Industrial Engineering - Computers deal with design,
• There are a number of methods in which educational
implementation, and improvement of integrated
institutions can use a computer to educate the
systems of people, materials, and equipment.
students.
•Architectural Engineering - Computers help in planning
• It is used to prepare a database about performance of
towns, designing buildings, determining a range of
a student and analysis is carried out on this basis.
buildings on a site using both 2D and 3D drawings.
Marketing
Military
Advertising - With computers, advertising professionals
Computers are largely used in defense. Modern tanks,
create art and graphics, write and revise copy, and print
missiles, weapons, etc. Military also employs
and disseminate ads with the goal of selling more
computerized control systems. Some military areas
products.
where a computer has been used are:
Home Shopping - Home shopping has been made
• Missile Control
possible through the use of computerized catalogues
that provide access to product information and permit • Military Communication
direct entry of orders to be filled by the customers.
• Military Operation and Planning
Healthcare
• Smart Weapons
Computers have become an important part in hospitals,
Communication
labs, and dispensaries. They are being used in hospitals
to keep the record of patients and medicines. It is also Communication is a way to convey a message, an idea, a
used in scanning and diagnosing different diseases. ECG, picture, or speech that is received and understood
EEG, ultrasounds and CT scans, etc. are also done by clearly and correctly by the person for whom it is
computerized machines. meant. Some main areas in this category are:
•Diagnostic System - Computers are used to collect data • E-mail
and identify the cause of illness.
• Chatting
•Lab-diagnostic System - All tests can be done and the
reports are prepared by computer. • Usenet
• Computerization of voter’s lists The output unit consists of devices with the help of
which we get the information from the computer. This
• Computerization of PAN card
unit is a link between the computer and the users.
• Weather forecasting Output devices translate the computer's output into a
form understandable by the users.
COMPONENTS OF A COMPUTER SYSTEM
Input Unit
All types of computers follow the same basic logical
structure and perform the following five basic • This unit contains devices with the help of which we
operations for converting raw input data into enter data into the computer.
information useful to their users.
• This unit creates a link between the user and the
Take Input The process of entering data and computer.
instructions into the computer system.
• The input devices translate the information into a
Store Data Saving data and instructions so that they are form understandable by the computer.
available for processing as and when required.
System CPU (Central Processing Unit)
Processing Data Performing arithmetic, and logical
• CPU is considered as the brain of the computer.
operations on data in order to convert them into useful
information. • CPU performs all types of data processing operations.
It stores data, intermediate results, and instructions.
Output Information The process of producing useful
information or results for the user, such as a printed • It controls the operation of all parts of the computer.
report or visual display. CPU itself has the following three components:
Control the workflow Directs the manner and sequence • ALU (Arithmetic Logic Unit) –
in which all of the above operations are performed.
•Memory Unit
Main Components of a Computer System
•Control Unit
Input Unit This unit contains devices with the help of
Output Unit
which we enter data into the computer. This unit
creates a link between the user and the computer. The The output unit consists of devices with the help of
input devices translate the information into a form which we get the information from the computer.
understandable by the computer.
This unit is a link between the computer and the users.
CPU (Central Processing Unit)
Output devices translate the computer's output into a
CPU is considered as the brain of the computer. form understandable by the users.
CPU performs all types of data processing operations. It
stores data, intermediate results, and instructions
(program). It controls the operation of all parts of the
computer.
2. Problem Analysis 4. If the keyname is the same with a name in the list,
add 1 to the count
3. Algorithm design and representation (Pseudocode or
flowchart) 5. If all the names have been compared, output the
result
4. Coding and debugging
Problem Definition
Problem Analysis
Let nameList = List of Names Program Flowchart - describes graphically in detail the
logical operations and steps within a program and
Let keyName = the name to be sought
sequence in which these steps are to be executed for
Let Count = 0 the transformation of data to produce the needed
output
For each name in NameList do the following
System Flowchart - is a graphic representation of the
if name == keyName procedures involved in converting data on input media
Count = Count + 1 to data in output form
Display Count
Terminologies
• Dev-C++ is a full-featured IDE for the C/C++ • A project groups several files with a common purpose.
programming language
• In our programs, projects will include a file with
• As similar IDEs, it offers to the programmer a simple metadata about the project (.dev), a file with C source
and unified tool to edit, compile, link, and debug code (.c), a file with object code (.o), and a file with
programs linking instructions (makefile.win)
• It also provides support for the management of the • Only the .c file must be explicitly created -the
files of a program in “projects” containing all the remaining files are automatically created by Dev-C++.
elements required to produce a final executable
Files Explorer window - shows the name of the project
program
and the included files. The project tab usually contains a
• Dev-C++ is a free software distributed under the terms single file with the source code of the program. In this
of the GNU General Public License pane, we can find two additional tabs: Classes and
Debug. Classes tab shows the functions of the program.
Dev-C IDE
Debug tab shows watched variables in the debugging
process.
• Run – contains group of commands used for running C To save source code in TC editor, follow these steps
program
1. Select Save command from file menu or press F2 key.
• Compile - contains group of commands used for A dialog box will appear. The default file name of source
compiling C program code is NONAME00.C
• Debug - contains group of commands used for 2. Type the name of file such as "first.c" and press Enter
debugging C program. key. You can also select a specific folder (or location)
where you want to save the file. Turbo C editor
• Project – contains group of commands used for
automatically assigns the file extension as ".c"
opening, closing and creating projects.
scanf – function used to input single character or Control strings may consists the mixture of three items
sequence of characters from the keyboard, it needs the 1. Character to be displayed
control string codes. Spaces are not accepted upon
2. Format command
inputting. Terminated by pressing SPACE bar.
3. Escape character sequences
Syntax: scanf(“control string codes", &identifier_name);
Escape Character Sequences
getch – function used to input a single character from
the keyboard without echoing the character on the \n – Newline
monitor
\t – Tab
Syntax: getch();
\b – Backspace
getche – function used to input a single character from
the keyboard, the character pressed echoed in the \\ - Backslash character
monitor \’ – Single quote
Syntax: getche(); \” – Double quote
getchar – function used to input a single character from %C -Character
the keyboard, the character pressed echoed in the
monitor, terminated by pressing ENTER key %d - Signed decimal
Syntax: putchar();
Syntax: puts();
OPERATORS
Assignment Operator
Arithmetic Operators
* - Multiplication
/ - Division
% - Modulus division
+ - Addition
- - Subtraction
== - is equal to
!= - is not equal to
&& - AND
|| - OR
! - NOT