Computer


a. Telecommunication is a system if transmission of sounds, images, texts or data in the form of electronic signals.
b. Modes for transmitting data from one device to another are Simple, Half-duplex, and full duplex mode.
c. Bandwidth is measured in bits per second.
d. Cat 5 cable is used with RJ-45 connector.
e. Microwave is a wireless technology that can be used to transmit data between two different computers.
f. MODEM is short form of Modulator-Demodulator.
g. Linux is an example of network operating system.
h. Peer-Peer network is group of computers, which acts as server and workstation.


WAN = Wide Area Network
MAN = Metropolitan Area Network
UTP = Unshielded Twisted Pair
STP = Shielded Twisted Pair
POP = Post Office Protocol
NIC = Network Interface Card
HTTP = Hyper Text Transfer Protocol
MODEM = Modulator Demodulator
SMA = Shape Memory Alloy
BNC = Baby N Connector

Protocol ---------------> Rules to exchange data
LAN ---------------> Network within a building
MAN ---------------> Network within a city
Coaxial ---------------> BNC
Cat 5 ---------------> RJ-45
Hub ---------------> Central device for star topology

a. Data communication system is the collection of hardware, software and other devices that allows exchanging data, information and voice between two or more devices through a wire or radio waves.
The components of data communication are as follows:
Data: This is the data that is to be communicated.
Sender: This is the device used to send data.
Medium: This is the device through which the sender makes communication to the receiver.
Receiver: This is the device which receives data sent by the sender.
Protocol: This is the set of rules that are followed nu the sender and the receiver to make communication possible.

 The differences between simplex and duplex modes in communication are as follows:
Simplex Mode
Duplex Mode
In this mode, the transmission can take place in only one direction.
In this mode, data can be transmitted in both direction but only to one direction at a time.
Examples: TV broadcasting, Radio transmission etc.
Example: Wireless, handset and walky-talky.


Differentiate between bridge and router is given below:
Bridge
Router
It is a device that connects two or more similar types of networks.
It is a device that connects two different networks.
It does not use the address for filtering and forwarding the data.
It uses the address for filtering and forwarding the data.

 A computer network is a logical or physical interconnection between two or more computers such that they could communicate with each other.
The advantages of computer network are as follows:
i. A computer networked environment allows faster, easier and reliable transfer of data files from one computer to another.
ii. A network computer allows sharing of networked connected peripherals and simultaneous access to programs and data irrespective of the physical location of the resources and the user.
iii. Computers in network can access the network connected hardware devices like printer, scanner, disk drives etc.
 . The three models of network are as follows:
i. Client - Server Network
ii. Peer - to - Peer Network
iii. Centralized Computing Network
i. Client Server Network
It is a type of network in which each computer in a network is either a client or a server. It is an arrangement where some programs, files or other resources located on one computer called the server but are available to other systems on the network, called clients.

 Protocols are the sets of rules that the computer on the network must follow to communicate and to exchange the data with each other.
The names of the protocols are as follows:
FTP = File Transfer Protocol
SMTP = Simple Mail Transfer Protocol
TCP/IP = Transmission Control Protocol/ Internet Protocol
ARP = Address Resolution Protocol
POP = Post Office Protocol
HTTP = Hyper Text Transfer Protocol
PPP =
CDP = Cisco Discovery Protocol

 Each computer on any types of network needs a hardware component to control the flow of data. The device that performs this function is Network Interface Card (NIC), commonly called network card.
 A network topology refers to the shape of the network in which all the computers are connected together.
Star Topology
Star topology is a network topology where each individual piece if network is attached to a central node. The attachment of these network pieces to the central component is visually represented in a dorm similar to a star.

i. The advantages and disadvantages of bus topology are as follows:
Advantages
i. It is easy to set up and extend bus network.
ii. Cable length required for this topology is the least compared to other networks.
iii. Bus topology costs very less.
iv. It is mostly used in small networks. It is good for LAN.

Disadvantages
i. It is not suitable for networks with heavy traffics.
ii. It is difficult to detect and troubleshoot fault at individual station.
iii. There is limit on central cable length and number of nodes that can be connected.
iv. Security is very lows because the entire computer receives the sent signals from the source.


Local Area Network
A Local Area Network (LAN) is a network of computers that are relatively near to each other and are connected in a war that enables them to communicate by a cable and a small wireless device. A LAN consists of just two or three computers to exchange data or share resources or it can include hundreds of computers of different kinds.

Metropolitan Area Network
Metropolitan Area Networks (MANs) are large computers networks spread over a city or neighboring cities. A MAN can have a group of many LANs. Especially, big companies, banks, offices etc. have their branches or sub offices in a city or in neighboring cities. They use MAN to connect with their branches or sub offices for communicating data and information. The communication media in MANs may be optical fiber or unbounded communication media like microwave system, infrared system, radiowave to link their branches and sub offices.

Wide Area Network
Wide Area Network is a telecommunications network usually used for connecting computers that spans a wide geographical area. WANs can be used to connect cities, states or even computers. Typically, it will employ communication circuits such as long distance telephone wires, microwaves and satellites. WANs are often used by larger corporations or organizations to facilitate the exchange of data. The world's most popular WAN is the Internet.

 Difference between LAN and WAN are as follows:
LAN
WAN
  • A LAN is restricted to a limited geographical coverage of a few kilometers.
  • WAN spans greater distance and may operate nationwide or even worldwide
  • Data transmission speed is much higher in LAN.
  • Data transmission speed is slower in WAN than in a LAN

 The advantages and disadvantages of star topology are as follows:
Advantages
i. As compared to bus topology, it gives far much better performance.
ii. Easy to connect new nodes or devices. In star topology new nodes can be added easily without affecting rest of the network.
iii. Centralized management. It helps in monitoring the network.
iv. Failure of one node or link does not affect the rest of network. At the same time it is easy to detect and troubleshoot it.

Disadvantages
i. Too much dependency on central devices. If it falls whole network goes down.
ii. The use of hub, router or a switch as central devices increases the overall cost of the network.
iii. Performance and as well number of nodes which can be added in such topology is depended in capacity of central devices.


MODEM
MODEM stands for Modulator Demodulator. It is the device that converts digital data to analog form and vice versa. It is a device used to transfer the data of one computer to another using telephone lines.

Repeater
The signals transmitted become weak due to some problem in the transmission mediums or the distance between the two locations. A repeater is a device that amplifies the incoming signals, creates a new copy of it and transmits the signals on the network. Repeaters are required in the network where computers are a part of each other.

Hub
A hub is a hardware device that relays communication data. A hub sends data packets to all devices on a network, regardless of any MAC addresses contained in the data pocket. It is a device with multiple ports that allows network devices to be connected together. It acts as a central networking device in the star topology.

Bus Topology
A bus topology is a network topology in which nodes are connected in a daisy chain by a linear sequence of buses. It is an arrangement of computers on a local area network in which each computer is connected to a central cable through which data is channeled.

Ring Topology
Ring topology is a network topology in which each node connects to exactly two other nodes, forming a single continuous pathway for signals through each node - a ring. Data travel from node to node with each node along the way handling every packet


Number system is an organized and systematic way of representing numbers.
 The number system which is formed by 0 to 9 is called decimal number system.
The base or radix of a number system defines the range of possible values the digit may have.
  The number and character set of hexadecimal number system are as follows:
Numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Characters: A, B, C, D, E, F

Binary Coded Decimal (BCD) is a system of writing numerals that assigns a four-digit binary code to each digit 0 through 9 in a decimal (base 10) numerals.
American Standard Code for Information Interchange (ASCII) is a code for representing English characters as numbers, with each letter assigned a number from 0 to 127.




  Cyberspace has become synonyms with the Internet.
  Cyber Law includes a wide variety of legal issues related to the use of communication technology.
  Digital signature is a security mechanism system in the cyberspace for digital data processing and their   
  transformation.
  Cyber-crime refers to illegal actions involved in any computer.
  The law which is enacted to ensure the preservation, integrity and reliability of data is called Data               Protection and Privacy Law.


a. UNCITRAL = United Nations Commission on International Trade Law
b. WWW = World Wide Web
c. EDI = Electronic Data Interchange
IT = Information Technology

a. Cyber law refers to all the legal and regulatory aspects of Internet and World Wide Web.
It is important because for the following reasons:
i. It is required to overcome the cybercrime in the internet.
ii. It is important for the eradication of the illegal activities done in the internet.
iii. It touches all the aspects of transactions and activities on and concerning the internet and Cyberspace.

b. Digital Signature is the mathematical scheme for demonstrating the authenticity of a digital message or document.
It is important because it provides a legal framework to facilitate and safeguard electronic transactions in electric medium. It is also necessary to keep the uniformity standard and guarantee in all the activities of the e- sector.

c. The digital signature allows the user to attach a code on the document of electronic records or Electronic Data Interchange (EDI) in various e-sectors for the data transformation such as e-mail, e-banking, e-business etc.

d. Cybercrime is defined as any type of illegal activity that makes use of the Internet, a private or public network, or an in-house computer system.

e. Intellectual property refers to creations of the mind, such as inventions; literacy and artistic works; designs; and symbols, names and images used in commerce.
Intellectual property includes various laws such as copyright law which is related to computer software, computer source code, trademark law which is related to domain names, semi-conductor law which is related to the protection of semi-conductor design and layout.

f. Telecommunication is a system if transmission of sounds, images, texts or data in the form of electronic signals.

g. The purpose of the enactment of the cyber law of Nepal, 2004 are as follows:
i. Provides a legal framework to facilitate and safeguard electronic transactions in the electronic medium.
ii. To facilitate electronic filing of documents with the Government agencies and to promote efficient delivery of government services by means of reliable electronic records.
iii. Provides a detailed provision for the Controller of Certifying Authorities to regulate Certifying Authorities.
iv. Provides legal status to digital signatures sent by the electronic media, which would be an important provision to introduce e-banking.
v. Provides legal status for various banking signatures sent through the electronic media, which will be instrumental in boosting economic activities throughout the world via Internet.

h. Computer ethics is the branch of practical principles that deals with how the computer experts should make decisions in regard to the social and professional behavior. It is a set of moral principles that regulates the use of computers.
The computer ethics are as follows:
i. One should not interfere with other computer's work.
ii. One should not provide fake information.
iii. One should not use the computer to steal.
iv. One should not copy or use proprietary software for which they have not paid.
v. One should not create a virus and use it.

Fair credit reporting Act <-----------------------------> 1970
Copyright <-----------------------------> Intellectual Property
Cyber Law of Nepal <-----------------------------> 2004
Video Privacy Protection Act <-----------------------------> 1988
Copyright Act <----------------------------->1992
Freedom of Information Act <-----------------------------> 1970
Federal Privacy Act<-----------------------------> 1974
Digital Signatures <-----------------------------> Encryption and Decryption

.

 In the computer, we store important data and information, which can be destroyed, damaged, hacked, etc. by different factor.
 The recommended computer room temperature should be 21-24 degree Celsius.
 Due to faulty writing or overloaded sockets, short circuits can take place, which can cause fire and damage the computer.
 UPS is a battery supported power unit between an external power source and a computer system, which supplies clean and continuous power even during power failure.
 Computer virus is a computer program that has been created to damage your computer system.


Computer security refers to the protection of computer system and its valuable information against unwanted access, damage, modification or destruction. Some computer hardware security measures are as follows:
i) Regular maintenance
ii) Insurance
iii) Dust free
iv) Air condition system etc.
And some computer software security measures are as follows:
i) Password protection
ii) Backup system
iii) Defragmentation
iv) Scan disc

b. The protection of all hardware components used in computer system is known as hardware security. The computer equipment, software and data need to be protected from physical harm like fire, lightening, water, etc. as well as damage or theft, which is possible by hardware security which helps in protection of computer system.

c. Software security secure the data and software from getting lost and damaged and helps to insure privacy. It also protects data and software from the computer viruses. So, software security helps to prevent data loss.

d. Backup is a copy of a file which is used in the event of the original file being corrupted.
Data backup protect the user against may failures such as:
i. Media failure
ii. Accidental file deletion
iii. Theft and natural disaster

e. A password is a secret word or phrase that gives a user access to a particular program or system. Any four good criteria for a strong password are as follows:
i. Do not keep a password which can be easily guessed such as date of birth, nickname, etc.
ii. Do not keep a password that is similar to your name or surname.
iii. Do not keep word as a password that is currently popular.
iv. Keep changing your password regularly.

f.
i. Scandisk: Scandisk is a process, which involves in maintaining the disk files and folders using a kind of utility software.
ii. Computer virus: Computer virus is a computer program that is designed to copy itself and infects or damages a computer without permission or knowledge of a user.

g. A voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level. The voltage regulators used in computer system are as follows:
i) LM723
ii) LM117
iii) MC1723
 
h. The differences between defragmentation and fragmentation are as follows:

Defragmentation
Fragmentation
  • Defragmentation is the process of locating the noncontiguous fragments of data, rearranging the fragments and restoring the, into fewer fragments or into the whole file.
  • The scattering of the parts of the same disk file over different locations is called fragmentation.
  • It increases the data access and retrieval speed of the disk.
  • It decreases the data access and retrieval speed of the disk.

i) Backup <-----------------------------> Copy of data
ii) password <-----------------------------> allows the user to access system
iii) Scan Disk <-----------------------------> Utility software
iv) Computer virus <-----------------------------> Software that destroys data


a. A computer virus is a type of program that replicates itself by making copies of itself without your knowledge.
b. Multipartite viruses can infect both the application programs and the boot sector of a disk.
c. A macro virus is a type of computer virus that infect both the application programs and the boot sector of a disk.
d. Boot sector viruses replace the boot record program of a system disk.
e. Antiviral software is designed to detect and remove viruses from computer system.



a. A computer virus is a type of computer program that can replicate itself by making copies of itself by making copies of itself without the user's knowledge or consent.

b. Computer virus spread from following ways:
i. Opening the infected email attachment.
ii. By downloading infected programs from the internet.
iii. By using infected floppy disk, pen drives and CDs.
iv. By transferring an infected program over a network and executing it.

c. The various type of computer virus are as follows:
i) Boot Sector Virus
Boot Sector virus is regarded as one of the most hostile types of virus, a boot sector virus infects the boot record of a hard or a floppy disk. The virus moves the boot sector data to a different part of a disk. This virus allows the actual boot sector data to be read as though a normal start up were occurring.
ii) File Infecting Virus
This type of virus infects program files on a disk. When infected program is launched, the virus code is also launched. After the virus code has been launched, it will normal load and execute the program that has been infected.
iii) Multipartite Virus
This virus is the combination of parasitic and boot sector virus and due to this, it is able to infect both the files or boot sector of a disk. They infect program files and when it is executed, these viruses affect the boot record.
iv) Macro Virus
These viruses infect the Microsoft Office programs such as Excel, Word, Access and PowerPoint. When we open the Microsoft program then the virus is loaded and it affects the normal template or document. Since it is attached in the document, if the infected document is opened on other computer, it affects the computer too.
v) Script Virus
Script Virus is written in script programming languages, such as VBScript and JavaScript. It can infect a computer through various scripting environments, such as Windows Help, Windows installation files and Windows registry files.

d. Boot sector virus destroys or infects the boot sector of the disk where Master Boot Record (MBR) is stored. MBR is a small program which is responsible for booting the computer system.

e. The symptoms of computer viruses are as follows:
i. Programs take long time to load.
ii. Renaming all the files with different names.
iii. Shows unusual error messages on the screen frequently.
iv. Corrupt or deletes system data and programs.

f. Anti-virus software is a computer program designed to detect and remove viruses from the computer system. Any two examples are as follows:
i. McAfee Antivirus ii. Kaspersky Antivirus

g. We can avoid the virus attacks by following ways:
i. Scanning the email attachment before executing them.
ii. Use of a good anti-virus program to scan for viruses.
iii. Scanning the disk frequently for viruses.
iv. Not installing the pirated software, especially computer games.


a. Multimedia is the multiple forms of media.
b. CD-ROM is used to store data and information in the multimedia technology.
c. Multimedia enhances the information for better communication and understanding.
d. Virtual Reality is an artificial environment created with the computer hardware and software and presented to the user in such a way that it appears real.
e. Virtual reality uses headsets and data gloves.

a. Multimedia is a computer delivered electronic system which allows the user to control, combine, and manipulate different types of media. The media used in multimedia technology are text, sound, graphics, animation etc.

b. Multimedia is a system, which has the capability to integrate two or more types of media such as text, graphics, animation, audio and video. It also has the capabilities of getting input, digitizing, compressing, decompressing, storing, retrieving the data and information and demonstrating them in an interactive manner. For example:

c. Multimedia technology is very popular specially to share the ideas, views, thought of the people in an effective and interactive way.

d. A CD-ROM is light, cheap, durable ad portable storage media is used to store data and distribute information in the multimedia technology. Hence, CD-ROM is popular in multimedia technology.

e. Several movies, nowadays, contain many visual tricks, which could never be accomplished without the aid multimedia technology. In the movies, a man being transformed to ghost, woman etc. are shown by using multimedia graphic technique called morphing. English movies like Titanic, Robot, etc. have used multimedia technology for providing special effects. In the cartoon films, the natural movement of cartoon pictures is shown using the animation of multimedia technology.

f. Using a multimedia program, which incorporates text and sound, a learner can see words and phrase on the screen as they are pronounced by the computer program. The learner also has flexibility to request the computer to pronounce any word displayed on screen by selecting that word. Additional features may be incorporated in the program to assist in faster learning process.

g. Due to the arrival of multimedia technology, it is making possible to keep interactive and exciting sound, graphics or animation in the video games available in the computer. Sound and animation have been made possible to adopt in the video game by multimedia technology. Graphics are particularly important features in these applications that make the game thrilling and exciting for the user.

h. For sales promotion, companies often advertise their products and services on television. Several of these advertisements use computer animation effectively communicate the usefulness of the products or services.

i. Multimedia is used for education and training in schools. It is used for education to produce computer based training and reference books like encyclopedia. It allows the students to learn different subjects at their own pace. It also brings presentations alive with sounds, movies, animations and interactivity and motivates students to become active participants in the learning process.

j. The advantages of multimedia are as follows:
i. It can store data and information for a long period of time
ii. It increases learning effectiveness.
The disadvantages of multimedia are as follows:
i. Acquisition or rental of equipment to produce multimedia can be costly.
ii. Copying and altering digital images may unknowingly lead to copyright infringement.

k. Virtual Reality is an artificial environment created with computer hardware and software and presented to the user in such a way that it appears real.


a. MS-Access is Microsoft software which is used to manage database and edit them.
b. In MS-Access, maximum characters are typed in Text field is 64 characters.
c. A column in a table is called field and a row in a table is called records.
d. A primary key uniquely identifies a record.
e. Examples of Database Management System are MS Access, FoxPro and Oracle.
f. The field grid pane displays columns in which you can enter the field names, the data type for each field, and a description of each field.
g. In MS-Access, we design a table using Table Design view.
h. A select query extracts and arranges information form a table in a manner that you specify.
i. Examples of database are dictionary and directory.
j. Delete query is an example of Action query.
k. Query that makes changes in table is called action query.

a. A collection of related information that is used to store, organize and extract data is called database.
The elements of database are as follows:
i. Field
ii. Record
iii. Table

b. DBMS is a computer program designed to manage a database and run operations on the data requested by the clients.
Oracle, MS SQL, MS Access etc. are some well-known database management system.

c. The advantages of DBMS are as follows:
i. Database saves the data.
ii. Data can be stored in a small area or space in computerized database.
iii. Database protects from unauthorized access and use of data.
iv. It saves data from being lost.

d. Microsoft Access is a relational database management system that runs on the window operating system.
The features of MS Access are as follows:
i. It guarantees the consistency of the data stored.
ii. It also facilitates the easy and timely retrieval of the data stored.
iii. It allows updating, deleting and manipulating the stored data.

e. Database Window MS Access is a window based data management system.
The objects present in the database window are as follows:
i. Reports ii. Tables iii. Queries iv. Queries

f. The primary key is a special column or group of columns in the table whose value must be unique in the table.
Primary key is required to relate tables using a field known as primary key field. This field is a field is a field that uniquely identifies each record.

g. Sorting data is the arrangement of data on the basis of a field or fields of a table either in ascending order or in descending order.
The advantages of sorted data over unsorted data are as follows:
i. It becomes systematic.
ii. It becomes easier to view data.
iii. It consumes less time to search for data.

h. Caption is used to display an alternate name for the field to make the field name more explanatory.
Data Validation enables you to limit values that can be accepted into a field.

i. Form is a database object used primarily to display records onscreen, to make it easier to enter new records and to make changes to the existing records.
From are used because it allows you to design the layouts of the field on the screen in any arrangement.

j. A report is an access object that presents information according to the user specifications.
Report is required in DBMS for following reasons:
i. IT provides the user answers about the information in the user's database.
ii. It acts as a summary of the data contained in one or more tables or queries.



a. Computer cannot work without a program.
b. Computer programmers are responsible for designing, writing and modifying computer programs.
c. QBASIC is an example of high level language.
d. Errors in computer program are called bugs.
e. Algorithm and flowchart are two important tools to design a solution.
f. Two types of errors in computer programs are syntax errors and logical errors.
g. The exclamation (!) symbol at the end of a variable name declares integer variable.
h. A variable name should not contain number or a character.
i. Different types of expressions supported by QBASIC are string, numeric and symbols.
j. AND operator is an example of logical operator.

1.
a. A never terminating loop is called infinite loop.
b. The FOR-NEXT loop does not work if the initial value is bigger than the final value and step is missing.
c. WHILE-WEND loop works if the condition is true.
d. WHILE-WEND is a pre-test loop structure.
e. DO-LOOP is a post-test loop structure.
f. A loop within another loop is called nested loop.

2.
Statement
Syntax
Purpose
FOR-NEXT
FOR Counter = Start value to Final Value
T execute a series of instructions the given number of times.
WHILE-WEND
WHILE
Program statements
Increase/decrease the value of variable
WEND
To execute a series of statements in a loop as long as the given condition is true.
DO-LOOP UNTIL
DO UNTIL CONDITION
Statements block
LOOP
In DO UNTIL loop, the iterations or repetitions continue as long as the condition is false or until the condition becomes true.
DO-WHILE LOOP
DO WHILE CONDITION
Statement block
LOOP
It repeats block of statements while the condition is true or until the condition becomes true.

3.
a. Control flow structure is instructions, statements or group of statements in a programming language which determines the sequence of execution of other instructions or statements.
The basic control structures of QBASIC are as follows:
I. Sequential Structure II. Loop Structure III. Selection Structure

b.
Sequential Structure
Loop Structure
A sequential structure is a control structure that tests a condition then executes one sequence of a statement instead of another, depending upon the condition.
A loop structure is a logic, which is used to execute one or more than one statement for a number of times.
The sequence structure simply executes a sequence of statements in the order in which they occur.
A loop allows a group of statements to be executed a certain number of times depending upon the condition.

c. A loop structure is a logic, which is used to execute one or more than one statement for a number of times.
Loop in a program allows for repeated iteration over the same set of instructions. Depending on the type of loop and the constraints will depend on how many times those instruction get repeated.

d. Never terminating loop is called Infinite loop. Pressing "Ctrl + Break" or "Ctrl + C" keys breaks the infinite loop.

e. Counter is a program which is used when one needs to count how many times a program executes a loop.

f.
Pre-test looping statement
Post-test looping statement
This loop structure checks the condition before executing statements of loop.
This loop structure tests the condition after executing statements of looping structure.
It may not execute at all.
It may execute statements block at least once.
 



Function name
Syntax
Purpose
LEN ()

LEN (string expression)

It returns a number of characters in a string.

MID$ ()
MID$ (stringExp, start, length
It extracts the specific number of characters from a string.
LEFT$ ()
LEFT$ (string expression, n)
It extracts specific number of characters beginning from the left-most character of the string.
VAL ()
VAL (x$)
Converts a string expression consisting of digits into numeric mode.
INT ()
INT (x)
It is used to round the numbers to their integer values.
ABS ()
ABS (x)
To obtain the absolute value of numeric mode.
STR ()
STR$ (x)
To convert a numeric expression to its string expression.
SQR ()
SQR (x)
It returns square root of any positive number.

4.
a.
STR$ ()
VAL ()
It converts a numeric expression to its string expression.
It converts a string expression consisting of digits into numeric mode
Its syntax is STR$ (x)
Its syntax is VAL (x$)

b.
ASC
CHR$
It finds ASCII code of a character.
It is used to retrieve the single character represented by the ASCII number.
Its syntax is ASC (string expression)
Its syntax is CHR$ (n)

c.
RIGHT$
MID$ ()
It extracts the specific number of characters beginning from the right-most character of the string.
It extracts the specific number of characters from a string
Its syntax is RIGHT$ (string expression, n)
Its syntax is MID$ (stringExp, start, length)

5.
a. Functions are ready made programs, which manipulates data and return a value, which may be a string or a numeric form type. Once function is written and debugged, it can be used again and again. For example; ASC function, FUNCTION-END FUNCTION etc.

b. The difference between user defined and library function are as follows:
User defined
Library
It is a function that is written by the user.
It is a function that is provided as part of the standard language and is common to all.
In user defined, QBASIC allows you to define your own functions and refer to them by a name.
In this function, QBASIC provides readymade functions that can be used to develop powerful programs that perform multiple tasks.

c. String functions can be defined as a set of alphanumeric characters. String functions are also called string manipulators since they are used to manipulate strings. And numerical functions are used for mathematical calculations.

d. Functions in QBASIC are readymade programs, which take some data, manipulate them and return a value, which may be a string or a numeric type. Once a function is written and debugged, it can be used again and again. Thus, function makes our work easier.


i. The modular programming language is a language which uses the technique called "Divide and Conquer" to solve a problem in which a problem is divided into different small manageable program blocks.
Advantages of modular programming are as follows:
a. Different programmers can design different program modules independently, which is required in large different program modules independently
b. It is easy to design code and test the program modules independently.
c. It is possible to use a single module in different places, which reduces the program codes.

ii. The difference between Function procedure and sub procedure are as follows:
Function procedure
Sub procedure
A function must return a value.
Sub procedure does not return value.
A function is called by statement and expression method.
Sub procedure is called by CALL statement.

iii. A sub-program is a procedure which is used to divide a program into well-defined structures and fulfills the objective of the program. Any four features of a sub-program are as follows:
a. A call to a sub-program can pass specific argument values for the sub-program to work with, which are called arguments.
b. Arguments can be passed to the sub-program by reference or by value.
c. Arguments 'sent by reference' serve as a medium for sending information back to the calling procedure.
d. Variables used inside a sub-program are local by default.

iv. Functions can be defined as a formula to perform any task quickly. The difference between Built-in function and user defined function are as follows:
Library function
User defined Function
It is a function that is provided as part of the standard language and is common to all.
It is a function that is written by the user.
In this function, QBASIC provides readymade functions that can be used to develop powerful programs that perform multiple tasks.
In user defined, QBASIC allows you to define your own functions and refer to them by a name.

v. The difference between arguments 'passed by value' and 'passed by reference' are as follows:
Arguments 'passed by value'
Arguments 'passed by reference'
Arguments 'passed by value' is local to the sub-program.
Arguments 'passed by reference' serve as a medium for sending information back to the calling procedure.

vi. The difference between Function procedure and sub procedure are as follows:
Function
Sub procedure
A function must return a value.
Sub procedure does not return value.
A function is called by statement and expression method.
Sub procedure is called by CALL statement.



a. QBASIC is a high level programming language.
b. It is possible to use a single module in different places, which reduces the program codes.
c. Arguments can be passed to the sub program by value or reference.
d. 'Argument by value' is sent to procedures by enclosing argument variables byparenthesis.
e. Variables defined inside a sub-program are local by default.
f. Defining of a sub-program always begin with a SUB statement.



a. A program is a collection of instruction written in a computer language.
b. The files of computer are classified into program file and data file.
c. QBASIC supports two types of data. They are random data file and sequential data file.
d. The open statement has two types of data file. They are creating a new file and appending to the end of an existing file.
e. WRITE # statement is used to write data to the opened data file.
f. INPUT # statement is used to read data from the opened data file.


3.
Statements
Syntax
Purpose
OPEN
OPEN "File mode", # filenumber, "file name"
It opens a sequential file for one of the three possible operations.
CLOSE
CLOSE [#filenumber]
It closes one or all open files.
WRITE#
WRITE [#filenumber,]
It sends one or more data items to the specified file.
INPUT #
INPUT #filenumber
It reads the data input from a file on the disk.
INPUT$ ()
INPUT$ (n, [#filenumber])
It reads the specified number of characters from the data file.
EOF ()
EOF (#filenumber)
It detects the End OF the File marker reading the data from an OPEN sequential file.
KILL
KILL filespec$
It deletes the file or files from the specified drive and directory.
NAME
NAME "oldname" AS "newname"
It renames a file on a diskette.
FILES
FILES [Filespec$]
It displays the files of the current subdirectory or specified subdirectory.
MKDIR
MSDIR Path
It creates subdirectory which is used to manage files.
CHDIR
CHDIR Path
It allows QBASIC to change from one directory to another.
RMDIR
RMDIR Path
It is used to remove or delete only subdirectory from a disk.

5.
a. File is a collection of data or information or instruction which are stored permanently in the secondary storage device using a unique name called file name.
The difference between program file and data file are as follows:
Program file
Data file
  • Program files are required by a program to actually run.
  • Data files are the files that you create.
  • It refers to sets of instructions that are put together to build up the application you will be using.
  • It is basically the application's feeding as it provides what is needed for your program to work and converts single pieces of data on understandable information.

b. Sequential data file is a file that must be accessed in a sequential order, stating at beginning of the data block and preceding in order until an end-of-data market is encountered of the required number of items has been read and random access file is a file that can be accessed in any order.

c. The advantages of creating data file are as follows:
i. Once a data file is created, it can be reused.
ii. It can be used to store output for the future use.
iii. A data file can store a large amount of data.
iv. Different programs can share the same data file.

d. The three different operations of data file are as follows:
i. Opening a file
ii. Writing a data to a file
iii. Closing a file

e. The difference between INPUT and LINE INPUT statement are as follows:
INPUT
LINE INPUT
It is used to read data items from a sequential data file and assign them to program variables.
It is used to read an entire line without delimeters from a sequential file into a string variable.
The syntax of INPUT # is
INPUT # filenum, variable list
The syntax of LINE INPUT is
LINE INPUT # filenum, string variable

f. File number is an integer expression between 1 and the maximum number of files allowed. It is used when the file is opened for the output.

g. Difference between input mode and output mode is that input mode is used for reading data or information from a data file whereas output mode is for writing data or information to a new file.

h. The difference between output mode and append mode is that output mode is for writing data or information to a new file whereas append mode is for appending information or data to the end of an existing file.












































































a. C is a high level language.
b. QBASIC is a structure programming language.
c. C language was originally developed by Dennis Ritchie in 1972.
d. PRINTF is a library function in C.
e. PRINTF is a statement in QBASIC.
f. Every C program must start with built-in functions.



4.
a. C is well-oriented high level language which is a general purpose, block structured, procedural computer programming language.

b. The basic data types in C are as follows:
Data Type Consumption
Char 1 Byte
int 2 Byte
float 4 Byte
double 8 Byte

c. Variable is a named storage location in the computer's memory for holding a piece of information. It has a name and value. Each variable has a type that determines what you can store in it. The rules for constructing variables names are follows:
i. Variables names must begin with an alphabet or underscore.
ii. A variable name length should not be exceed 40 or unlimited in some compiler
iii. C keywords/ reserved words should not be used as variable's name.

d. The differences between local and global variables are as follows:
Local Variables
Global Variable
A program variable whose scope is limited to a given block of code, usually a subroutine is called Local Variable.
A variable whose value can be accessed and modified by any statement in a program, not merely within a single routine in which it is defined as Global variable.

e. Decision making statements are those statements which choose among different courses of action available during a program's execution. There are two major decision making statements supported by C. They are as follows:
i. if statement
ii. Switch statement





 

Post a Comment

0 Comments