Professional Documents
Culture Documents
APPLICATION 2008 - 09
S I
Study
..by Mr. P.H.Prasad Materia
l
COMPUTER APPLICATIONS - ID YEAR
BBM SECON
(a) RAM : RAM means Random Access Memory. A read / write memory
is called as Random Access Memory. As the name implies, data can be read or written
into this memory. If the information is available in a fixed time regardless of its address,
the memory is a random access memory.
To write the data , the address is placed on the address bus and the chip is informed
that a writing operations is going to take place, by enabling the WRITE pin. Then the
data is placed at the data bus which is then stored. Similarly to read the data , the
address and the RE4AD pin are enabled and the data is retrieved without disturbing
the actual content. The data stored is said to be volatile, which means that once the
power supply is removed, the contents of the memory is lost.
The Random Access Memory comprises of the main memory of the
computer system . It can be used for storing of data temporarily in memory chips. If we
have more RAM, the complex software’s, which require more memory capacity can be
stored . The RAM chips are arranged in rows and installed in the mother-board of the
computer. There are two types of RAM .
1. Dynamic Ram (DRAM)
2. Static Ram (SRAM).
The DRAM is often used because of its simplicity and less cost. However,
it requires recharging periodically in Milliseconds. This makes DRAM slightly
complicated. But comparatively its packing density is more than SRAM.
The SRAM stands for the ensured data, that is , momentary power supply
flickers cannot corrupt the data because recycling / recharging is not necessary. But
SRAM is costly and requires more area. But SRAM and DRAM are volatile.
(b) APPLICATION PROGRAMS :
An application program is designed to handle a particular task required by the end –
user . It handles all aspects of a routine application, including error situations , the display
of menus to aid the user thus making it possible for a user having very little computer
expertise to process the application . For example a financial accounting package
may have an opening menu featuring all required options such as entry of data into
different accounts, producing and printing balances sheets and analysis of expense
accounts. All input / output transfers and error situations are automatically handled by the
package itself, no direct communications being required between the user and the
operating system. Displays and outputs are in formats suitable to the user’s needs.
Packages may be routine packages or may be designed for a specific
purpose :
Example of applications packages :
- Production control packages :
- Production scheduling
- Bills of material processing
- Labor costing
[[
Payroll
- piece work calculations
- Bonus calculations
- Credit control
(c) WHAT IS SEQUENTIAL FILE
For information to be useful it should not only be recorded , but it should also be
easy to access and retrieve the information when required.
For organizing records efficiently in acomputer file.
Syntax :
EDIT <scope> FIELDS <list> FOR condition /
WHILE condition
CHANGE command is identical to EDIT .
CHANGE <scope> FIELDS <list> FOR condition /
WHILE condition
( e ) SAY and GET command
This statement is used to display the text at a row and column.
@ symbol followed by row and column.
Row and column notation starts at 0,0 , which is first row and first column on
the screen.
Therefore , rows are 0 – 24 for a 25 line and columns are 0 - 79 for a 80
columns screen.
SAY and GET statements are used individually or in combination with @ row,
column .
Example :
@ 7,10 say “ What is your name “ line 1
@ 7, 50 get name line 2
@ 11, 10 say “ Pin Number “ line 3
@ 11,50 get pin line 4
READ
In above program,
Line – 1 display the question “What is your name “ at
row 7 and column 10th position on the
screen.
Line-2 allows data entry from the key board into
‘name‘ variable.
Line – 3 display the question “PIN number “ at
row 11 and column 10th position on the
screen.
Line-2 allows data entry from the key board into
‘pin‘ variable.
‘READ’ statement is used to read to the GET
statement into the specific field / variable.
(f) INDEX command
If we want to search the record very fast, then that database file must be indexed.
Indexing is a process in dbase III plus use to provide the data in ascending order to
locate the data very quickly.
When using indexing , dbase iii plus create a new index file , this index file later user
can use .
But this index file is linked to the database.
The records in the database is in the same physical order . These records was not
disturbed. When user open the index file , then only database records was in
ascending order.
How to do index file ?
- first open the database file by using USE command.
- INDEX ON <key expression> TO <index filename>
- This index file name extension is .NDX.
- Advantage of index file is , when user modify the data (add, delete, edit ) in
the database file, automatically, index file will be updated.
- Now if we want to search a record in index file by using FIND and SEEK,
then it was very fast.
- Using indexed files can help with the speed problems of locate.
Ex :
USE EMP
INDEX ON EMPNO TO EMPIND
100% indexed.
(g) BROWSE command
‘BROWSE’ command is to display a ‘screenful’ of the database and allow you
to scan and make changes to the database.
By using browse, display the records for editing and appending also.
If you need to alter several records at a time , then we can use ‘BROWSE’.
If the records are longer than 80 characters , we can not see all the record on
the screen at once.
So , we can move across the record a field at a time using Control and thus
display the relevant field for alteration.
BROWSE FIELDS <field list > [ LOCK <expression> ]
FREEZE < field > ] [NOFOLLOW] [ NOMENU]
WIDTH <exprN> ] [ NOAPPEND]
a=10
b=5
If (a > b) then
? “ first number is big “
else
?” second number is big”
Endif
( I ) SERIAL ORGANIZATION (SEQUENTIAL FILE )
In a serial file, each data record is placed in turn in the next available
storage space. The record keys need not be in any particular order , and
there may be no relationship between the logical position of an item on the file and its
physical position on the device. Records can only be accessed in the order in which
they occur on the storage medium.
In sequential file organization , records are held and accessed in a predetermined
sequence of keys . Records can be organized in numerical , alphabetical or
chronological order.
Magnetic tape is a common medium for storing sequential and serial files.
Files however may also be stored on disk, which allows convenient storage and faster
access than on magnetic tape. Data however , must be retrieved sequentially .
A file on a magnetic tape has :
A header record containing identification information.
Blocks of data
Trailer record with reconciliation information.
2. What do you mean by System Software ? Explain the Advantages
Software is the part of the computer system which enables the hardware
to operate.
Computer software can be divided into two major classifications.
System software
Application software
System software included the computer programs that run a computer system itself or
that assist a computer in running application programs . It also includes the
documentation that describes how these programs operate.
System Software consist of
Operating System
Utilities
OPERATING SYSTEM
An operating system is an integrated set of specialized programs which permit
the continuous operation of a computer from one program to the next with the minimum
amount of operator intervention.
Through the O.S the computer can supervise its own operations by automatically
calling in the applications program, translating any other special service programs, and
managing the data to produce the desired output.
Thus the OS tends to isolate the hardware from the user. The user communicates
with the OS supplies application program and inputs data that are in a language and
format acceptable to the OS and receives the output results.
From the largest mainframes and supercomputers to the small personal
computers almost all computer system run under OS control. The general goal being
to operate the computer with a minimum of idle time and in the most efficient and
economical way during the execution of user programs.
While personal computer generally use disk operating system DOS ie. Operating
system whose instructions are mostly stored in disk and transferred into the CPU only
as needed, many mainframes and minicomputers use operating systems that presently
reside in primary memory.
MULTI PROCESSING :
Multi processing is the execution of two or more different programs at the same time.
Typically, in multi processing multiple CPUs sharing a common memory are
used . Instructions from different and independent programs can be processed at the
same instant by different processors. On the other hand the processor may
simultaneously execute different instructions from the same program.
Multiprocessing system can be classified as :
a) Loosely coupled multiprocessing
b) Functionally Specialized processors
c) Tightly Coupled multiprocessing
d) Parallel processing
Multi processor system , there are two or more CPUs . Each CPU has a
control unit. ALU, registers and in some cases, cache. An interconnection mechanism
allows each CPU access to a shared main memory and input / output devices. The
processors can communicate exchange signals. Memory is organized so that there is
multiple simultaneous access to separate blocks of memory . In some configurations ,
in addition to the shared resources each CPU may have its own main memory and I / O
Channels.
The entire system is controlled by an integrated operating system. The OS
provides interaction Between processors and their programs.
TIME SHARING :
Time sharing allows a large number of users at various remote terminals to
simultaneously use a centrally located for problem solving. Each user operates
independently and receives such fast response that he has no awareness of the use of
the facility by others. The OS which as the time sharing facilities supervise the scheduling
or jobs, transfer control of the central processor from one user to another and moves
programs in and out of the main memory. In effect, the computer gives time on a
rotational basis to the users. Ordinarily the elapsed time between spurts of attention to
the user is so brief that he has the impression that he alone is being served.
The time sharing system results in an economic advantages which is the primary reason
for its extensive use.
Operating System Facilities :
Multi programming however, presented complex organizational problems. Some of the
operations required to run each program are :
Program loading
Loading of input data
Loading of files
Allocation of the peripherals to the program
Monitoring of the program’s actions
Obeying program request (i.e interrupts)
A number of describe features of a comprehensive operating system are :
- Job control language
- Failure and recovery
- File security
- Logging
- Scheduling
- Monitoring system status
- Multi-access control
SOFTWARE UTILITIES
These are programs or routines which carry out certain procedures which are common to
virtually all applications. Utility programs are different from applications packages.
Application packages are complete systems for specific computer applications. Ex.
Financial accounting , pay roll , inventory control
Utility software performs needed services such as :
Sorting records into a particular sequence for processing .
Ex : A number of outstanding invoices may be processed in date order. The date is used
as the key field . Then all the invoices for one day may be sorted on invoices number, the
number can be minor key field.
Thus by using the command SORT in a source program the computer will provide the
necessary routine. The programmer does not have to write a separate sort program.
- Merging several sorted files into single updated large file
- Transferring data from one I / O device to another.
- Printing of files held on backing storage.
- Printing the contents of main memory.
Job control statements tell the operating system which utility programs are needed.
3. Explain the procedure for creation of a database file in Dbase III plus.
Database is nothing but collection of field names and records.
This file extension is .dbf.
Dbase III plus can accept a lot of data.
Each record can contain up to 128 field names or 4,000 characters.
Maximum one billion records we can enter in one d database file.
Dbase III plus having various types of field names like
Character field
Numeric field
Date field
Logical field
Memo field
Character field :
character data consist of alphabetic characters ,numerals and punctuation characters.
Character field can be from one to 254 characters in length .
Ex : names, address, descriptions , part numbers, telephone nos.
Numeric field :
Numeric data types are used to store numbers for calculation. In dbase , numbers can be
up to 19 digits long.
Ex : subject marks, employee number, student roll number, employee salary , item
amount etc.,
Logical field :
Logical data types are used for ‘yes ‘ or ‘no’ data that is either true or false.
This field accept only one character like ‘y’ , ‘n’ , ‘t’ , ‘f’.
Date filed :
- This field stores data in the form of
mm/dd/yy.
- you no need to specify a length for date field as dbase fills in the default
value of 8 characters .
- Memo field :
- This is special type of field to store free-form text in an efficient manner.
- When entering the data in memo field, dbase iii display the word processor
. So user can enter the data very easily.
- Memo field can be up to 4,000 characters long .
- This file extension is .dbt.
How to create database file :
In dbase iii plus, user can create the database by using two methods.
They are a) Assistant menu
b) dot prompt
Assistant Menu :
In the sub menu, lists the drives , first user select the disk work area .
Enter the name of file and press Enter key .
No need to enter the file extension , dbase iii plus provides .dbf automatically.
Enter the field specifications like field name , type (c, n, l, d, m) , length .
By pressing Ctrl + End key , save the complete structure.
Now display the following message :
“ input data records now ? ( Y/N) “
Type ‘y’ to enter the data.
After entering the records , press Ctrl + End to save .
Dot Prompt method
. ?day(date())
08
3) Month() : It returns the numeric value of the month from a date variable.
This must be beween 1 to 12.
. ?month(date())
01
4) Year() : it return the numeric year from the date variable. It display 4 digit
of the current year.
. ? year (date())
2009
5) Dow() : It returns the numeric code for the day of the week from a date
variable. Monday is day number one.
. ? dow(date())
2 (i.e Tuesday)
6) Cdow() : It returns a character day of the week instead of the numeric day
of the week like Monday, Tuesday etc.,
. ? cdow(date())
Tuesday
7) Cmonth() : It returns name of the month for a date .
. ? cmonth(date())
January
8) Ctod() : This function convert the character date into date format.
Ex. 1 . ? cmonth(ctod(“12/09/08”))
December
Ex. 2 . Display all for duedate >=ctod(“06/01/86”)
9) Dtoc() : This is opposite of Ctod(). This function convert the date format
into character format.
10) ?time() : It return current time in hh:mm:ss format. (i.e system time)
. ? time()
10:20:40
5) Describe the procedure for Label Creation in dbase III ?
Mailing label form is used to design the addresses for mailing purpose.
Firstly open the database file by using USE command.
The field characteristics within the selected database file are used to help the design
the label form.
By using CREATE or MODIFY LABE command , we can designed the label format.
Once designed the label form , by using LABEL FORM <fielname> to produce the
label form on the screen.
LABEL FORM <fielname> TO PRINT command is used to print the labels on the
printer as it is displayed on the screen.
The default extension given a label form file is .LBL.
How to generate the label form ?
Open the EMP.DBF file and give the CREATE LABEL command.
Then dbase displays a menu screen with three items in the main menu as follows :
- Options
- Contents
- Exit
By default the menu items OPTIONS is highlighted. In the menu item OPTIONS , there
are 7 sub-items . By default “ Predefined sizes “ is highlighted .
Contents having
OPTIONS
Predefined size : 31/2 x 15/16 by 1
Label width : 35
Label height : 5
Label margin : 0
Lines between labels : 1
Space between labels : 0
Label across page : 1
Contents
Label contents :
1.
2.
3.
4.
5.
By pressing enter key and press F10 to display all field names of the current database
file. Then select only by one field name from the list. These field names to be display on
the screen as mailing label.
Press CTRL + W to save the label file and return back to dot prompt.
How to run the label form ?
. LABEL FORM <filename>
To display on the screen .
LABEL FORM <filename> TO PRINT
This command is to print labels on the printer.
6) What are the different editing commands in dbase III?
There are several ways to edit the data in dbase iii plus.
The following keys are used to edit the data.
→←↑↓ to move the record pointer
around the editing form.
Pgup , Pgdn : to move the record pointer from one record to another .
Del key : to delete characters
Ctrl + w / Ctrl + End : to save the modified data.
Dbase III plus having to the following editing commands.
a) update b) append c) edit d) browse e) replace
a) UPDATE :
The update menu allows full screen editing of records within in the database . User
can add , alter or delete records . If user is editing the records in index file,
automatically updated.
Syntax :
UPDATE ON <key filed> FROM <alias> REPLACE<field > WITH<exp> [,< fields>] WITH
<expr2> [ RANDOM ]
b) APPEND
Append command is used to add the records to the active database.
C) EDIT command
‘ EDIT ‘ command is used to alter a record.
EDIT command , display the current record for editing.
After editing the record contents, then user has to press Control - End key /
Control – w to save .
If correct record is not selected for editing , then move one record at a time by
using PgDn, PgUp , ← → ↓ ↑ keys.
In the EDIT command, we can use condition also.
Syntax :
EDIT <scope> FIELDS <list> FOR condition /
WHILE condition
CHANGE command is identical to EDIT .
CHANGE <scope> FIELDS <list> FOR condition /
WHILE condition
d) BROWSE command
‘BROWSE’ command is to display a ‘screenful’ of the database and allow you
to scan and make changes to the database.
By using browse, display the records for editing and appending also.
If you need to alter several records at a time , then we can use ‘BROWSE’.
If the records are longer than 80 characters , we can not see all the record on
the screen at once.
So , we can move across the record a field at a time using Control and thus
display the relevant field for alteration.
BROWSE FIELDS <field list > [ LOCK <expression>] [ FREEZE <
field > ] [NOFOLLOW] [ NOMENU] [WIDTH <exprN> ] [ NOAPPEND]
e) REPLACE :
This command is used to replace the content of field for all records or for
records meeting a specified condition.
i.e replace the old values with new values in the records.
Syntax :
Replace [<scope>] <field> WITH <exp> [,<field2> WITH
<exp2>… ] [ WHILE <condition>] [FOR condition]
7) Explain various library functions in BASIC
Basic contains built-in library functions, which perform some computations .
The following functions are available in Basic language. They are
Function Meaning
Abs(x) Absolute value of x
Atn(x) Arctangent of x
Cos(x) Cosine of x
Exp(x) ex value. Where e=2.71828
Int(x) Integer of x. i.e remove the decimal places
Log(x) Natural Logerithmec of x
Rnd(x) Generate random numbers between 0 to 1
Step 1 :
. Modify command si.prg
(open the program file)
Step 2 :
Type the following Program
Set talk off
P=0
T=0
R=0
SI=0
Clear
Input “ Enter Principle Amount “ to P
Input “ Enter Rate “ to R
Input “ Enter time “ to T
SI=(P * T * R)/100
?”Simple interest is “ , SI
return
press Ctrl + End key to save the program.
Step – 3
. Do si.prg ( to get the output)
Enter principle amount 2000
Enter Rate 10
Enter time 3
Simple interest is 600
9. Write a basic program to create a data file containing the details of name, roll
no. and marks in four subjects of 100 students.
Basic having two types of files.
They are
- Sequential file
- Random file
10 Rem this program is to store 100 student details in stud.dat file.
20 rem rno à Roll number
30 rem sname$ à student name
40 rem maths à maths marks
50 rem phy à physics marks
60 rem chem. à chemistry marks
70 rem eng à English marks
80 rem open the file for writing mode
85 open “o” , #1 , “stud.dat”
90 for i=1 to 100
100 input “ enter roll number “, rno
110 input “ enter student name
120 input “ enter maths marks “,maths
130 input “ enter physics marks “ , phy
140 input “ enter chemistry marks “,chem.
150 input “ enter English marks “,eng
160 Write #1, rno, sname$, maths,phy,chem.
170 print
180 Next I
190 close #1
300 end
The above program is used to store 100 student details and write into stud.dat file by
using ‘for’ loop.
SECTION – B
(compulsory)
Write a program to evaluate the sales performance of N sales representatives each
selling M products. The comparison should be based on the total value of the
products sold by each representative.
Solution :
10 Rem ** Salesman Problem **
20 Dim R(10) , P(10)
30 Read N,M
40 Rem ** R(J) = Cost of Jth Product ***
50 For J= 1 to M
60 Read R(J)
70 Next J
80 Rem – P(J) = Number of Jth Product Sold **
90 Let I = 1
100 Let C=0
110 For J=1 to M
120 Read P(J)
130 Let C=C+P(J) * R(j)
140 Next J
150 Print “ Sales Man “ , I,C
160 If I=N then 999
170 Let I = I + 1
180 Goto 100
190 Data 5, 5
200 Data 100,150, 200, 250, 300
210 Data 1,2,3,4,5
220 Data 2,3,4,5,1
230 Data 3,4,5,1,2
240 Data 4,5,1,2,3
250 Data 5,1,2,3,4
999 End
Output
SALESMAN 1 : 3500
SALESMAN 2 : 3000
SALESMAN 3 : 2750
SALESMAN 4 : 2750
SALESMAN 5 : 3000
BBM-II
COMPUTER APPLICATIONS – I
UNIT – 1
INTRODUCTION TO COMPUTER
1. Explain the generation of computers ?
The term “generation” was belongs to hardware and software .
The computers can be divided into FIVE generations. i.e depending
upon the technologies used.
1st Generation : (1946 to 1955)
Comparatively large in size .
Produce lot of heat .
Basic component is Vacuumed Tubes.
Low capacity internal storage.
Individual , non-related models.
Speed in milli seconds.
Internal storage consisted of magnetic drum and delay lines.
Restricted computing capacity
Short life span
Complex maintenance schedules.
Speed of operations is 40 to 300 additions / second.
2nd Generation : (1956 to 1965)
Smaller in size compared to the first generation.
Generated a lower level of heat.
Basic component of these computers is Transistors.
Transistors occupy small space .
More powerful than Vacuum tubes.
Increase reliability.
Higher capacity of internal storage.
Related series of processors – the family concept.
Processor operand in the micro seconds speed.
High cost direct access storage.
Speed operation is 3,000 to 30,000 additions / second.
3rd Generation : (1966 to 1975)
Basic component of this computer is Integrated Circuits (ICs).
The peripheral devices can be classified as Input devices, output devices and
Backing storage devices.
The Input devices allow the user to get the data into the machine . A large rang of
input devices are available Ex : keyboard , mouse
The output devices are peripherals used to output results to the user . They
include printer, monitor , plotters.
Backing storage devices are used to store data and programs permanently . Ex :
hard disks, disk packs, floppy disks and tapes.
- storage
- accuracy
- versatility
- automation
- diligence
- reliability
Speed :
- Computer speed is measured in nanoseconds / picoseconds .
- There fore computer is fastest processing electronic device.
- For example , add two 18 digit number in 300 to 400 nanoseconds ,
computer will be processes.
Storage :
- Computer can store massive information and reused again after years.
- For storing data, we used secondary storage devices like floppy, hard disc,
compact disc, Pen drive , tape etc.,
- Storage capacity measured in bytes, kilo bytes, mega bytes and gigabytes
Accuracy :
- computers are very accurate.
- Computer make the mistake because of faulty program , physical circuit ,
mistake made in feeding data or poorly designed system.
Versatility :
- computer are capable of performing any type of task.
- Computers are used in every field like washing machine, microwave oven
etc.,
Automation :
- computer can run automatically without any human intervention.
- Computer is an intelligent device and execute the program step by step.
Diligence :
- Computer does not show any signs of fatigue, tidiness, lack of
concentration or lost interest.
- The speed , accuracy and quality would be absolutely same in the first
and last calculation.
Reliability :
- All the above qualities of the computer make them reliable and also make
us too dependent on them.
- Computers can run for years and years without any loss of date or any
other problem.
Digital computers count the numbers (for digits ) that represent
numerals , letters or special symbols.
Mainly used in automobiles to control fuel , banking systems, etc.,
Hybrid Computers :
The feature of analog and digital machines are combined to create
hybrid computing system.
For example , analog devices measure a patient’s heart functions .
These are then converted to numbers and supplied to the digital
components that monitor the patient’s vital signs.
COMPONENTS :
SIZE :
Modern computers size is in very small like palm.
Computers can be classified as
Mini Computers
Micro Computers
Portable Computers
Super Computers.
Micro Computers :
- smallest type of computer .
- Inside this computer , arithmetic and control unit are combined on single
chip called “ Micro Processor “
- Micro computers are used in home, small business purpose , doctor
maintain patient information etc.,
Mini Computers :
- These computers are powerful than micro computers.
- Data processing is very quickly.
- First mini computer name is PDP-8 launched in 1965.
- Medium size organizations may use it for processing of payrolls and
financial accounts , handling of costing , sales analysis etc.,
Main Frame Computer :
- Main computers are far more powerful .
- Main frames are very large computers with a very high capacity of main
store.
- This is used big companies , banks , governments departments .
- They can be linked into network with smaller departmental computers.
- Example of Main frame computer is IBM-4381 , ICL-39.
Super Computer :
- Complex scientific applications like weather forecasting require a large
amount of data to be manipulated with a very short time.
- This computers have multiple ALUs.
- Each ALU is specialized for particular operation and all capable of
performing simultaneous or parallel processing of different tasks.
- Example : CRY XMP-24, NEC-500.
UNIT – 2
COMPONENTS OF COMPUTER
1. Explain the parts of C.P.U
This question answer refer to Examn paper code
6240/5 question no. 1 , page no. 2
2. Explain the Main Memory of the computer ?
The memory unit of the CPU is a place , where programs or instructions and
data are stored ,while processing.
The device consist of a number of storage locations.
Each storage location may be identified by a unique number which is called it
address.
During processing data may be stored in any location which is identified by the
address of the location.
The storage area may be designed to store a fixed number of characters
which are treated as a single entity or word.
Memory address may be Word Addressable or Character Addressable.
If one word is stored in one location is called “Word addressable” and each
character is stored in each cell is called “ Character addressable “
Main Memory is a combination of RAM and ROM.
RAM : (Random Access Memory)
Semi conductors elements are used in primary storage sections or main
memory.
Semi conductor storage elements are small integrated circuits.
The storage cell circuits and the support circuitry needed for reading and
writing data are packaged on chips of silicon.
A number of semi conductor storage technologies are in use.
However, chips that use metal-oxide semi conductor technology are usually
used in the primary storage section.
The components are called Random Access Memory chips
It is possible to read from and write to any location within RAM by specifying
its location or address.
New data can be written onto any location , however , while doing so the
previous existing data is erased.
RAM chips may be classified as
- Dynamic Ram
- Static Ram
Dynamic Ram chips
The storage cell circuits contain
- a transistor (functions like a mechanical on-off lights switch)
- a capacitor used to store an electric charge.
Depending on the switching action of the transistor , the capacitor may have
no charge or hold a charge .
The charge on the capacitor must be periodically refreshed or recharged.
So it is volatile memory
Static Ram chips
It is also volatile storage devices.
As long as supplied with power, they do not require special regenerator
circuits to retain the stored data.
More transistors and other devices are needed to store a bit in static RAM.
These chips are more complicated than Dynamic RAM.
The size of the memory units in the CPU is often inadequate, when large
programs need to be stored or large amounts of data need to be processed.
To overcome this drawback the technique of virtual memory is used.
The program is divided by the software into pages or segments.
Only that portion of the program and data that is being processed is kept in
primary storage .
Part of backing storage is treated as an extension of the main memory and
information that is into required is swapped in and out of main store by the
O.S.
Thus size of the memory becomes equal to the size of primary memory
storage plus the size of secondary storage being used.
Processing time is automatically increased.
Cache memory
Cache memory is small, fast memory is provided between the CPU and main
memory .
Using cache memory , the size and speed of main memory can be increased.
A relatively large and slower than main memory is used together with a
smaller , faster cache memory.
A copy of portions of main memory is maintained in cache.
When the CPU reads a word of memory, it first reads cache, if found the word
is delivered to the CPU.
If it is not found in cache, a block of main memory consisting of some fixed
number of words is read into cache.
The word is delivered to the CPU.
3. Explain the secondary storage devices ? OR Explain the auxiliary storage ?
OR explain data storage devices OR Explain Backing Storage Devices ?
The secondary storage devices are also called as External or
auxiliary memory backing storage.
These devices are used to hold mass information’s which can be
desirably transferred at any time.
It holds larger amounts of data than main storage.
Though this is less expensive , this takes much time to access the
data
Secondary storage devices are
- Magnetic Tapes
- Magnetic Disks
- Floppy Disks
- Hard disks
- CD-ROM
- Smart Cards
- Optical Memory Cards
- Flash Memory Cards
Magnetic Tapes
Magnetic Tapes are plastic tapes coated with magnetic material
such as ferrous oxide.
By passing this tape under a coil, where the data is fed in the form
current, we can magnetize the tape.
For reading back, the tape is passed under coil.
The digital data is converted into electric current which is passed
through the write coil.
This current throughout the coil, generate magnetic flux which is
stored on the magnetic surface of the tape.
The tape is divided into number of tracks and the data is stored in
block forms and are separated by an identification gap called Inter
Record Gap (IRG) or Inter Block Gap (IBG).
UNIT – 3
OVERVIEW OF DBASE III PLUS
1. What is database ?
Database is nothing but collection of information in a structured way.
We can say that it is a collection of a group of facts.
Our personal address book is a database.
Student information is a database . It contains roll number, student name,
maths subject marks, physics subject marks, chemistry marks etc.,
Delete :
This command is used to delete the records temporarily.
Records can be marked for deletion. By using BROWSE
command, we can verify that the correct records have been
marked before permanently removing the records.
Syntax :
Syntax is
LOCATE [ scope ] FOR [ condition ]
Example :
. USE STUDENT
. LOCATE FOR MATHS>=80
The computer will prompt
RECORD 5
You want to continue the search give the command
. CONTINUE
RECORD 8
. CONTINUE
RECORD 10
. CONTINUE
End of LOCATE scope
. USE STUDENT
. INDEX ON RNO ON STUDX
. USE STUDENT INDEX STUDX
. FIND 1020
. DISPLAY
The main difference between SEEK and FIND commands is that SEEK
command will not work with macros , but FIND command is used in macros.
LIST
LIST command is used to display all records from the current database
file.
Example
. USE STUDENT
. LIST
Now display all records from the student file.
When all the records can not come no a single screen the records scroll
down and we can not see the records in the beginning .
In order to overcome this problem, we have to use DISPLAY ALL
command.
DISLAY ALL command displays screen wise records and pauses , until the
user presses a key to continue.
DISPLAY
This command is used to display the current record details .
Example :
. USE STUDENT
. GOTO 5
. DISPLAY
Now display the 5th record details
. GO TOP
. DISPLAY
Now display the 1st record details
. GO BOTTOM
. DISPLAY
Now display the last record details
MODIFY STRUCTURE
The MODIFY STRUCTURE command helps to change the
structure of an active database file.
Example
. USE STUDENT
. MODIFY STRUCTURE
Now display the structure of STUDENT database file.
After modification of fields, then user has to press CTRL + W to save .
The MODIFY STRUCTURE command also allows deleting fields or
changing the field type and widths.
If reduce the width, the data in that field may be lost.
Hence changes to existing fields must be made with proper care.
UNIT – 4
FUNCTIONS & PROGRAMMING
1. Difference between Sort & Index ?
Sort Index
* Create a new database file * Does not create a new database file.
* Arrange the records in ascending or * Arrange the records only in ascending
descending order order
* file extension is .DBF * File extension is .NDX
* Slower than index file * faster than sort command
* Renumber the record numbers * does not renumber records
* Disk occupy more space * occupy less space
* If we delete/add/edit the records in * When we add / edit the records in original
original file, then sorted file is not updated file, then immediately update the index file.
2. Explain the types of Loops in Dbase III plus ?
(Do-while , For loop, loop and End loop )
3. Explain any 5 set commands ?
This question refer to final examn paper no. (5611/3)
Question no. 4 page no. 98
4. Explain the following functions in Dbase III Plus
a) Date Functions :
This question answer refer
to Examn paper code
6240/5 question no. 4 page no. 16
b) String Functions : Refer to Qno . 1 Unit – 5
page n o. 55
c) Mathematical Functions :
FUNCTION USE
LOG(x*y) Returns the log of the expression
X*y
ABS(expn) Absolute value of numeric operations
EXP(expN) Returns the value of the exponent
INT(expN) Returns the integer
LOG(expN) Returns natural Logarithm
ROUND(n,y) Round off to specific number of decimal
places
SQRT(n) Returns the square root of a positive
number
5) Explain the following commands :
a) Accept b) Input c) Wait d) Exit
a) ACCEPT :
The ACCEPT command presents a prompt on the screen and
waits for the user to respond by typing some text and pressing
ENTER key .
When user press ENTER key , then input text is stored into
memory variable.
Syntax :
ACCEPT [ <prompt>] TO <memory variable>
Example : ACCEPT “enter student name “ TO sname
EX :
use student
Do while .not. eof()
Display
wait
skip
Enddo
The above program is to display all records from the
student.dbf file.
For each record , temporary stop the execution until press
any key by using WAIT.
d) EXIT:
The exit command transfers control from DO WHILE loop to
the command line.
Do while loop is end with ENDDO
Example :
Do while (n<50)
?n
n=n+1
if (n=10) then
EXIT
Endif
Enddo
The above program is display 9 numbers .
If ‘n’ value reach 10 , then EXIT statement will be executed.
i.e exit from the program and return back to command line.
UNIT – 5
CHARACTER MANIPULATION AND DATABASE HANDLING
1. Explain the string functions.
Dbase III plus provides many functions for manipulating character type
data .
‘ + ‘ symbol is used for string concatenation
‘ $ ‘ symbol is used for search the string .
String Concatenation ( + )
String concatenation simple takes one string and add the second string .
Ex: ? “John” + “ William”
JohnWilliam
Search ($)
This symbol is used to search the given string into another string .
Ex : . Display all for “Steve” $Name
Steven
Stevenson
Stevenraj
Stevenes
The above example is used to search “Steve” name in the field name ‘Name’.
If condition is true , then only display the records.
String Functions
a) Trim : This function is used to removes trailing blanks from a
string. It is most useful for output purpose.
Example : ? “ Ronald “ + “Regan“
Ronald Regan
? Trim(“Ronal “) + “Regan”
RonaldRegan
b) LTRIM() : To remove the bland spaces from
the left end of a character
expression.
c) UPPER() : This function is used to convert
lower case to upper case.
?Upper(“computer”)
COMPUTER
d) LOWER() : This function is used to convert
upper case to lower case.
? LOWER(“PRINTER”)
printer
e) AT() : To search a character in a given string .
This function return to display the
position. It is very useful for
determining whether exists in a string
or not. If not found , it returns Zero
value.
? AT (“ter”, “computer”)
6
f) SUBSTR() : It returns substring from a main string . In this
function, we need three parameters. First parameter is the string to
take the substring of , the second parameter is the character position
to start the substring at and the third parameter is the number of
characters to extract.
?SUBSTR(“computer”,2,3)
omp
?SUBSTR(“printer”,1,3)
pri
?SUBSTR(“siva reddy”,6,5)
reddy
2. Write a prog. to find given number is Prime or not ?
Set talk off
Clear
Num=0
Input “ enter any number “ to num
M=3
Flag=0
If ( mod ( num,2)=0) then
?” Not a Prime number “
flag=1
else
do while (num/2)>M
If( (mod(num,m)=0) then
?” Not a Prime number”
flag=1
else
m=m+2
endif
enddo
If (flag=0) then
? “ Prime number”
Endif
Return
UNIT – 6
MULTIPLE FILE HANDLING
1. Explain the following commands clearly ?
a) Select b) Set Relation to
a) SELECT :
By use ‘USE’ command, we can open only one Data Base file .
Dbase allots a work area for that file.
But when we use multiple files (upto 10 files) , we have to specify
the area in which the different files will work.
UNIT – 7
INTRODUCTION TO BASIC LANGUAGE
1. Explain the types of operators in Basic language ?
There are three types of operators available in Basic language.
They are
Arithmetic operators
Relational operators
Logical operators
Arithmetic Operators :
All arithmetic operators are used to perform mathematical calculations.
Arithmetic operators are
+ addition
- subtraction
* multiplication
/ division
** Exponentiation
Relational Operators
> greater than
< less than
>= greater than equal to
<= less than equal to
<> not equal to
= equal to
Relational operators are used conjunction with conditionals.
IF (A>B) then
IF (A<B) then
IF (A=B) then
Ex :
10 let a=10
20 let b=20
30 if (a>b) then
40 Print “ a is big “
50 else
60 print “ b is big “
70 end
Logical Operators
Logical operators are
and
or
not
Logical operators are used in multiple conditions like
If (a>b and a>c)
If (maths <40 or phy <40 or chem. or 40)
Logical operators are binary operators.
Logical operators are performed “bit-wise” i.e the operations is performed
independently on each bit or pair of bits from the operand.
Logical operations table
AB Not A A and B A or B
1 1 0 1 1
1 0 0 0 1
0 1 1 0 1
0 0 1 0 0
2. Explain the Basic language?
BASIC language was first invented by J.G.Kemeny and T.E.Kurtz at
Dartmouth college, New Hampshire, U.S.A in 1964.
BASIC stands for B BUSINESS A ALLPURPOSE S SYMBOLLILC I
INSTRUCTION C CODE.
The basic language was designed to be conversational right from the start.
In BASIC, the instructional statements are almost similar to normal algebra
and therefore it is easy to understand and quick to learn.
BASIC contains less number of statements and its grammer is simple.
The important features of BASIC can be follows
Suitable for conversational programming.
Facility for manipulation of character strings.
Dynamic program debugging.
Ability to carry out arithmetic operations on matrices.
Provision for filling of programs and daa.
Simplified grammer.
Facilities for allowing more sophisticated formats for results.
Facilities for real-time execution and task scheduling.
Suitability to both mathematical and business problems.
Small interpreters and compilers are needed .
BASIC language having lot of features:
Control Commands and Editing
Text screen Printing
Key board input
Data types and Labels
Functions and Math Statements
Loops and Decisions
Subroutines and Functions.
Memory Access and Input and Output Ports
Data Files
Printing to the Network Printer from with a Program
Graphics
String Operations
The following are some general rules of writing a program in BASIC
All statements should be numbers . The numbers can be anything ranging
from 1 to 9999.
UNIT – 8
STRING AND ARRAY
1. Explain the types of loops in Basic (while, do, for )
BASIC provides three ways of performing a sequence of instructions over
and over again.
They are
WHILE loop
DO loop
FOR loop
The ‘WHILE’ loop
The while loop enables us to produce a piece of code that will only be
executed while a particular condition is TRUE.
‘WHILE’ is end with ‘WEND’ statement.
Syntax :
WHILE (condition)
Statements
WEND
The above statements execute until loop condition is TRUE.
While Example
WHILE (I<10)
PRITN I
I=I+1
WEND
The above program is display 1 to 10 numbers . i.e PRINT statement
execute 10 times .
DO - LOOP
This is second type of loop in BASIC.
10 INPUT A,B,C,D
20 LET N=A+B
30 LET D=C-D
40 IF D=0 THEN GOTO 10
50 LET X=N/D
60 PRINT X
70 GOTO 10
80 END
After calculating the values of N and D , the values of D is checked to
see whether it is equal to Zero or not.
If it is zero , the control is transferred to line number 10 thus avoiding a
division by zero.
When it is not equal to zero, the assignment statement 50 is executed
and after printing the value of X , the control is again transferred to line
number 10.
‘QBASIC’ allows the ELSE statement also .
Example :
If (a>b) then
Print “ a is big “
Else
Print “ b is big”
End if
In ‘QBASIC’ , IF is end with ENDIF
‘QBASIC’ support multiple ‘IF’ conditions also.
Example
If (quantity>5000) THEN
Cost=quantity * rate3
ELSEIF (quantity>4000) THEN
Cost=quantity * rate2
ELSEIF (quantity>3000) THEN
Cost=quantity * rate2
ELSE
Cost=quantity * rate1
ENDIF
3. Explain Library functions in Basic ?
This question answer refer to Examn paper code
6240/5 question no. 7 , page no. 22
4. Explain the types of Arrays (dimensions) in basic
Arrays is nothing but to store group of values in a single variable. i.e collection
of values grouped together under one common name.
Arrays are two types.
a) One dimensional array
b) Multi Dimensional array.
One Dimensional Array
One dimensional array is also called as Vectors.
Declaration should be starting of the program.
By using following statement , we can declare the array.
DIM marks (1 to 10)
That means , we can store 10 marks in marks variable
In this one variable name and one subscript will be there .
A single subscript variable is also known as “ One Dimensional Array “.
Example :
10 dim a(5)
20 for I = 1 to 5
30 read a(i)
40 next i
50 data 10,67,89,7,6
60 End
In above program, 5 values stored in ‘a’ variable.
When subscript variables are used in a program , certain
Information about them must be supplied before they are met :
1. Which variables are subscripted ?
2. What is the maximum size of each subscript.
‘DIM’ statement provide the above information like DIM A(5).
‘A’ is called variable name
‘ 5 ‘ is maximum size of array.
‘DIM’ is the short term of DIMENSION.
DOUBLE – SUBSCRIPTED VARIABLES
(MULTIPLE DIMENSION)
In basic language , we can store the values like a matrix format.
Instead of single dimension subscript variable, we have to use two variables.
DIM N(r,c)
R means number of rows
C means number of columns.
These values to store in ‘N’ variable like a matrix format.
Each value of the array can be described by appropriate values
of subscripts.
* DIM N(3,3) means we can store 9 values in N variable
like a matrix format.
* N(1,1) Ist value
N(1,2) 2nd value
N(1,3) 3rd value
N(2,1) 4th value
N(2,2) 5th value
N(2,3) 6th value
N(3,1) 7th value
N(3,2) 8th value
N(3,3) 9th value
Example :
11 DIM N(3,3)
20 FOR I = 1 TO 3
30 FOR J=1 TO 3
40 READ N(I,J)
50 NEXT J
60 NEXT I
70 READ 2,4,6,7,8,9,4,5,6
80 END
In above program, I refer to Row , J refer to column.‘N’ is the
array variable name.
First loop is for row , second loop is for column.
Function Results
CHR$(n) Returns character represented by the ASCII code n
SPACE$(n) Returns a sequence of ‘n’ blank spaces.
STR$(x) Returns the string representation of the number x
ASC(X$) Returns ASCII code of the first character of the string X$
VAL(X$) Returns the numeric representation of the string
LEN(X$) Returns the number of characters in the string X$
LEFT$(X$,n) Returns the left most ‘n’ characters of the string X$
RIGHT$(X$,n) Returns the right most ‘n’ characters of the string X$
MID$(X$,n,m) Returns a string with ‘m’ characters beginning with ‘n’
characters of the string X$
MKI$(x), MKS$(x), Converts numeric value to a string of required length.
MKD$(x)
CVI$(x), CVS$(x), Converts string to a numeric value of required type.
CVD$(x)
Example :
10 PRINT CHR$(65) result is ‘A’
10 PRINT SPACE$(10) , “GBS”
Result is 10 blank spaces GBS
10 PRINT STR$(1234) Convert 1234 numeric type to
string type “1234”
10 PRINT LEN(“computer”) 8
10 PRINT ASC(“BEST”) 66
10 PRINT VAL(“10”) + VAL(“20”) 30
10 PRINT LEFT$(“COMPUTER”,3) COM
10 PRINT RIGHT$(“COMPUTER”,3) TER
10 PRINT MID$(“COMPUTER”,4,3) PUT
Concatenation : ( + )
‘ + ‘ symbol is used for string concatenation . i.e merging of
two strings .
10 PRINT “NEW DELHI “ + “ IS THE “ + “CAPITAL OF “
+ “ INDIA“
NEW DELHI IS THE CAPITAL OF INDIA
UNIT – 9
FILE HANDLING
1. Explain the Sub-Routine AND functions ?
Basic language having very important features are subroutine and
functions
SUB ROUTINES
When we break a large problem into small steps by using subroutine.
When ever sub routine wants , user can call at any time from the
main program.
Sub routine program must be end with RETURN statement.
By using GOSUB n , user can call the sub routine .
After executing the sub routine , automatically return back to main
program.
Sub routine may contain many statements like a sub task.
In the above example having one main program and three sub
routine programs.
From the main program called the Sub routine programs.
After execution of Sub routine – 1 , return back go main program.
Again control goes to sub routine – 2
Like that sub routine – 3 also.
There fore output is
This is subroutine – 1
This is subroutine – 2
This is subroutine – 3
Important points , when use SUB-ROUTINE
Subroutine can be called only through the GOSUB statement.
The transfer from a subroutine to main program can be only through
RETURN statement.
Files classification done depending on the way the data is stored and
accessed .
Sequential File
Sequential files may be created on a magnetic tape or
magnetic disk.
Data from these files is read sequentially , item after item
starting at the beginning .
While the sequential files are quite efficient in the use of
computer storage space, they possess the disadvantage that we can not
read or change a particular data item directly.
Programs are written to read these data values
one after another .
Random Access Data Files
Random access data files are created on disks to allow us to read or
write from the files in random order .
Random access allow more flexible access than the sequential files.
You can read or write any record directly in a random file without
searching through all the records that precede it . Thus reading and
writing of data is faster.
Naming a File
- A file is identified by its file specification.
Device name : File Name
- The device name tells the system, which device to
Look for the file .
- File name tells which file to look for on that device.
- The device name followed by colon ( : )
- File name is maximum 8 characters.
- Extension consist of period and three letters.
Opening a File
Before reading or writing data from a file, that file must be opened by
using OPEN statement.
OPEN “mode”, # file number, “file name”
Mode is string constant and take one of the following three of them.
“ o “ for sequential output file
“ i “ for sequential input file
“ r “ for random input/output file.
File mode should be within double quotes.
File number
File number is an integer number and it can be any number between 1 to
15. It should be unique number.
File name
A file name specifies the particular file to be used . File name must be
within double quotes.
Closing File
Opened file can be closed by using CLOSE statement . CLOSE
statement followed by file number.
If file number is not mentioned , then all opened
files to be closed.
1Writing data to a File
We may write data to a sequential file by using PRINT # file number,
list of variables or
WRITE # file number, list of variables.
Difference between PRINT # and WRITE # is that WRITE # insert
commas between the data item and quotation marks for string
value.
While PRINT # causes data to be written without any delimiters .
PRINT #1, “KUMAR”, 1750 , the statement would write the following
image to the file #1.
KUMAR 1750 (without commas, quotes)
WRITE #1, “Kumar”, 1750 would write the following image to the file #1.
“KUMAR”, 1750 ( commas , quotes)
Note : Delimiters are very useful when we try to read
the data with an INPUT# statement.
STEP-3
Bringing data from the file to the buffer is done by the GET statement.
GET #file number, record number
GET #2, 10
Will transfer the content of the record number 10 from the file number 2 to the
buffer.
STEP-4
After GET statement , the data available in the buffer can be used by the
program for further manipulation and printing outputs.
In random files, all numeric date are recorded as string values. There fore
string values should be converted into numeric type by using
CVI convert a two-bytes buffer string to an Integer.
CVS convert a four-bytes buffer string to a single precision integer.
CVD convert a 8-bytes buffer string to a double precision integer.
X=CVI(u$)
X=CVS(u$)
X=CVD(u$)
U$ is the name of the string variable containing numeric values in the buffer and x
is a numeric variable.
Writing data into random file
10 REM *** CREATION OF RANDOM FILE ***
20 OPEN “R” , #1, “SALARY”,35
30 FIELD #1, 20 AS N$, 5 AS B$, 10 AS A$
40 INPUT “ ENTER 5 RECORDS NOW “
50 FOR I = 1 TO 5
60 INPUT “ ENTER EMPLOYE ENAME “,X$
70 INPUT “ ENTER BASIC PAY “,P
80 INPUT “ ENTER ALLOWANCES “,Q
90 PRINT
100 LSET N$=X$
110 LSET B$=MKS$(P)
120 LSET A$=MKS$(Q)
130 PUT #1, R
140 NEXT I
150 CLOSE #1
160 END
Reading records from random access file
10 REM * READ DATE FROM RANDOM FILE**
20 OPEN “R” , #1, “SALARY”,35
30 FIELD #1, 20 AS N$, 5 AS B$, 10 AS A$
40 PRINT “ RECORDS ARE “
50 FOR I = 1 TO 5
60 GET #1, I
70 LET P=CVS(B$)
80 LET Q=CVS(A$)
90 LET T=P + Q
100 PRINT
110 PRINT “ RECORDS ARE “;R,N$,P;Q;T
120 NEXT I
130 CLOSE #1
140 END
4. Explain the following Programs in Basic ?
a) Prime number
5 REM ** FIND PRIME NUMBER **
10 CLS
20 PRINT
30 INPUT “ ENTER ANY NUMBER “,N
40 PRINT
50 D=N-2*INT(N/2)
60 IF D=0 THEN GOTO 200
70 D=N-3*INT(N/3)
80 IF D=0 THEN GOTO 200
90 FOR I = 6 TO INT(SQR(N))+1
100 D=N(I+1)*INT(N/(I+1))
110 IF D=0 THEN GOTO 200
120 NEXT I
130 PRINT “ PRIME NUMBER “
140 END
200 PRINT “ NOT A PRIME NUMBER “
210 END
B.B.M – II
COMPUTER APPLICATIONS-1
PAPER-V
I. Answer the following questions . Each question 10
lines compulsory.
a) Control Unit
This question answer refer to Page no. 3 , Paper
code 6240/5 – Question no. I
b) Input Devices
It is the input and output devices that form the essential link
between the user of the computer system and the computer system
itself. These devices from the “interface” between the user and the
system.
Input devices are required to get raw data into the computer.
Output devices are those which output the processed information.
A, B , C ,D E … Z Single
Character (26)
String Variable
operator is the word “MOD” . The result represents the remainder from the division of the
first operands by the second operand.
ADDITION : Addition is a binary operation which requires two numeric operands and
produces a numeric result. The addition operator is the Plus sign . The result represents
the first operand plus and second operand.
j) What is an Array
This question answer refer to Page no.74,
Unit -8 Question no. 4)
1. State and explain the components of the computer
system.
This question answer refer to Page no.31, Unit -1 –
Question no. 2.
2. State and describe different types of memory devices.
This question answer refer to Page no.37, Unit -2 –
Question no. 2.
3. State and explain the different commands available in dbase to
store data in a .dbf file.
Data store commands are
REPLACE,UPDATE,APPEND,BROWSE , EDIT
This question answer refer to final examn paper no. 6240/5 ,
Question no. 6, page no. 20.
4. Describe different SET commands in Dbase.
Dbase III plus contains a large number of SET commands,
which modify the working environment of dbase III Plus.
SET commands Use
SET Display dbase III plus control parameters
SET BELL ON / OFF Turn bell ON / OFF
SET CENTURY ON / OFF Show century in date displays
SET COLOR ON / OFF Toggle between color / monochrome , default
depends on the system.
SET DATE AMERICAN / ANSI / Determine format of date fields, default is normally
BRITISH / GERMAN AMERICAN.
SET DECIMAL TO <n> Set minimum number of decimal places displayed.
SET DEFAULT TO <drive> Select the default drive.
SET DELETED ON / OFF When ON record marked for deletion are not
processed.