Communication and its modes and components
Communication and its modes and components
Communication: The process of exchanging message between sender and receiver through any medium using definite rule is called communication. If communication is done on a longer distance then it is called tele communication.
Data communication: The process of exchanging data and information between several electronic means and media through any medium using definite rule(protocol) is called data communication.
Components/Elements of communication
- Sender
- Receiver
- Medium
- Data
- Protocol: The set of rules through communication takes place.
Modes of communication:
- Simplex: Only sender sends information, receiver only receive the message. It is one way communication. Eg, Television, radio
- Half duplex: Sender sends the data while receiver receive the data and vice-versa. It is the two way communication but one at a time Eg, Walkie-Talkie
- Full duplex: It is two way communication in which sender and receiver both can send and receive information at same time. Eg, mobile communication.
Computer Network and its pros and cons
Computer network: A group of computer interconnected with each other through any medium using definite protocol (rule) for the purpose of sharing data, information, hardware, software and other resources. Services provided by the computer network.
- Data sharing
- Print service
- File service
- Database service
- Application service
Advantages/merits/pros/benefits/importance of computer network.
- It allows several user computer to share data and information.
- Expensive hardware like printer, scanner, fax can be shared in a network.
- Application programs and software can be shared in a network.
- We can easily communicate in real time i.e. faster communication.
- Easy to collect data through centrally located server.
Disadvantages/de-merits/cons/limitations of computer network.
- Skilled manpower required to install and operate a network.
- Expensive to install and operate.
- There may be security and privacy issue due to sharing.
- Virus and malware may be share in a network.
Transmission media and its types
Communication media/Transmission media/Communication channel
The medium through which data, information are transmitted from on point to another point in the form of signals are called transmission media. There are two types of transmission media.
A) Wired/bounded/guided media: The transmission media in which data are transmitted physically through cables or wire following a specified path.
a. Twisted pair: Wire are twisted with each other to reduce EMI(Electro Magnetic Interference).
- UTP(Unshielded Twisted Pair): Inner pair of twisted cable are not covered/unshielded with outer jacket. Hence, it has more EMI.
- STP (Shielded Twisted Pair): Inner pair of twisted cable are covered/shielded with outer jacket. Hence, it has less EMI.
b. Co-axial cable: These cable has higher bandwidth so, they are used in television broadcasting.
c. Fibre optics: These type of cable are made up with thin glass like material where data are transmitted in the form of photons(light). They have high data transmission rate.
Media connector:
- Twisted pair use RJ-45
- Co-axial cable use BNC
- Fibre optics cable use ST-connector
B) Wireless/unbounded/unguided media: The transmission media in which data are not restricted to travel in a closed path rather it can travel in open air. There is no any physical connection between communicating device hence, called wireless.
a. Microwave: Sender and receiver station must be in same line of sight (LOS). They cannot penetrate obstacle. Used for longer distance transmission. Satellite use microwave signal to uplink and downlink data from and to earth.
b. Radiowave: Sender and receiver station may not be in same line of sight (LOS). They can penetrate obstacle. Used by FM station and other local communicating stations.
c. Infrared: It use invisible red ray of light of electro magnetic spectrum for communication purpose. Eg, television remotes, AC remote and many more.
Types of Computer network
Types of network
- LAN: It stands for Local Area Network which connect device in smaller locations such as room, building, organization etc. It is suitable of single organization. It generally use guided media to connect devices.
- MAN: It stands for Metropolitan Area Network which can connect devices in larger geographical area such as town, city, village etc. It consist or two or more than two LANs. It use wired as well as wireless media for connecting devices.
- WAN: It stands for Wide Area Network which is set in a larger geographical are across city, nation and even ocean. It is can be used by multiple organization. Internet is the example of WAN, which is a public network across all around the world. They use wireless media for communication.
Network architecture:
- Client-server: In this type of architecture the devices in a network are connected to the centrally located main computer of a network called server. User computers are called client. It provides more security and control in a network. Server allows to mobilize all the resources available in the network. Easier to collect data in centrally located servers.

- Peer-to-peer: In this type there is no presence of main computer in a network, rather every computers in a network has right to control and use resources. Every computer in this case are client as well as server. Hence their will be less safety.

Network Models:
- Centralized model: This is a client-server model in which every devices of a network are connected to the centrally located main computer.
- Distributed model: This is the collection of several client-server model located at different location, all connected to a centrally located server.
Network topology and its types
Network topology: The physical layout, geographical orientation, connection pattern or arrangement of computer or devices (node) in the network is called network topologies.Types:
1) Bus topology: In this topology, every devices in the network are connected to a main single cable called trunk or backbone. It is easy and cheaper to setup. It require less amount of cables and adding new devices in a network is also easy. Where as, if there is fault in main cable then whole network will collapse. Fault finding is fairly difficult.

2) Star topology: In this topology, every devices in the network are connected to the centrally located device called hub which allows us to easily expand the network. Fault finding is very easy in this type. Whole network depends upon the hub so, if it fails network will collapse. It is expensive to setup but is most practical among all topologies.

3) Ring topology: In this topology, devices are connected with each other in circular manner each device having equal rights and responsibilities. Failure in one device will collapse whole network. Expanding network is difficult is not practical.

4) Tree topology: It is the combination of bus and star topology. Whole network depends on main cable and some part depend on hub so It is less reliable.

5) Mesh topology: In this topology, networking device are point to point connected with each other creating a mesh. If one device fails to work then it will not affect whole network. It is expensive and difficult to setup.

Some important term to remember
a. Bandwidth: The amount of data that can travel in a given transmission medium in unit time is called its bandwidth. It is generally known as data transmission speed and measured in terms of bps (Bit per second)
b. Protocol: The set of rules that guides the communication in the network. It is the language used by computers and electronic devices to communication with each other. For eg,
- TCP/IP: Transmission Control Protocol/Internet Protocol
- HTTP: Hyper Text Transfer Protocol
- FTP: File Transfer Protocol
- SMTP: Simple Mail Transfer Protocol
- POP: Post Office Protocol
- ARP: Address Resolution Protocol
c. Network operating system (NOS): It is the collection of program that helps to mobilize and manages resources of the network. For eg, Windows NT, Linux etc
Inter networking devices/hardware: Devices that are used to establish and expand network are called inter networking devices.
- NIC(Network Interface card): It physically connects computer system with transmission cable.
- Router: Intelligent device that connects two or more network. It facilitates finding best route for data transmission to destination.
- Repeater: Networking device that regenerates or amplifies the incoming signal.
- Hub: It is a multi port repeater.
- Bridge: Networking device that connects similar networks.
- Gateway: Network device that connects dissimilar networks.
- MODEM: Modulator Demodulator transfer analog signal into digital (Modulation) and vice versa (Demodulation)
- Multiplexer: It combines multiples incoming signal into one signal and opposite is called de-multiplexer.
Internet and its services
Define Internet? Explain services provided by the internet.
Internet is a network of network that connects millions of user and device all around the world together using TCP/IP (Transmission Control Protocol / Internet Protocol) and allows to share data and information in-between.
Services provided by the internet.
- Email: The way of exchanging mails i.e message between sender and receiver over internet using unique address (email address) is called email. Advantage of email: Faster, Cheaper, Reliable, Always available, Secured
- E-commerce: The process of buying and selling goods and services is called e-commerce. Eg, daraz, amazon, alibaba
- Telnet: It allows user to login remotely to another user computer.
- IRC: Internet relay chat allows user to communicate in real time.
- Video conferencing: It allows user to communicate in real time using video and audio signal.
Define web browser? Give some example
The application program which allow user to browse web site from internet are called web browser. It establish the communication between user and web-server so that user can access content of the web. It use HTTP (Hyper Text Transfer Protocol) to communicate. Eg, Google chrome, Mozilla Firefox, Opera, Safari, Microsoft edge (Internet Explorer), Netscape navigator.
Differentiate between E-mail and postal service.
Postal service | |
It is the modern digital way of exchanging information. | It is traditional way of exchanging information. |
Use of computers and internet. | Use of papers, post box and post office |
It is faster and reliable | It is slower and non reliable |
Recipient not required | Recipient required. |
It is always available 365 days a year. | It may not be always available |
Highly secured. | Less secured. |
Differentiate between intranet and extranet.
Intranet | Extranet |
Private network accessible with in the organization. | Private network accessible outside of the organization. |
They are limited with in organization. | They are extended among its branch. |
Some important terminologies:
- ISP: Internet Service Provider
- SMTP: Simple Mail Transfer Protocol
- POP: Post Office Protocol
- URL: Uniform Resource Locator
- DARPA: Defense Advance Research Project Agency
- FTP: File Transfer Protocol
- ADSL: Asymmetric Digital Subscriber Line
- CDMA: Code Division Multiple Access
- Web server: The storage location where every content of website are store.
- Home page: The introductory page or landing page of a website.
- Search engine: The web application which allows user to search content in WWW by using keyword. Eg, google, bing.
- Downloading: Transferring data and file from web server to user.
- Uploading: Transferring data and file from user to web server.
Unit 2: Ethical and Social Issues in ICT
Cyber law and its importance
Cyber law: The law which governs all the legal issues of cyber space, controls cyber crime, provide legal status to online transaction and covers several activity related to internet is called cyber law.
Importance of cyber law:
- To control cyber crime.
- Mitigates misuse of technology.
- To flourish IT industry in the nation.
- To legalize online transaction.
- To adopt and use new and modern technology.
Cyber law in Nepal was introduced in 30th Bhadra 2061 BS (15th September 2004 AD). The name of the cyber law of Nepal is “Electronic Transaction and Digital Signature Act – Ordinance.
Provisions of cyber law of Nepal.
- Identify and punish cyber criminals.
- Help to provide legal status to IT industry.
- Implementation of IT in governmental activities.
- Monitors data privacy and misuse of technology.
Cyber ethics and crime
Computer ethics: The moral principles and values or the code of conduct that must be followed by every computer user is called computer ethics. Commandments of computer ethics.
- Do not use computer to commit crime.
- Always use computer in the welfare of human being.
- Don’t use computer to steal data and file.
- Don’t use computer to publish fake news and information.
- Don’t use computer to bear false witness.
Cyber crime: The criminal activity or a crime committed by using computer, internet or any electronic means and media is called cyber crime. Cyber criminal are also considered as a criminal hence, cyber law has appropriate provision of punishing the cyber criminals. For eg, piracy, hacking, cyber bullying, phishing, salami saving, pornography, data diddling, spreading computer virus etc
Terms to understand:
- Intellectual property right: The law through which the creation(music, art, writings etc) made by creator gets actual reward and not being misused without proper compensation.
- Patent right: The law through which inventor protect his/her invention(technological) from being used without proper compensation.
- Digital signature: It is the technology used to ensure the correct delivery of message over a network. It use private and public key for encryption and decryption of data.
- Encryption: The feature by which readable data and message are converted into unreadable code and its vice versa is called decryption.
- Trade mark: The sign or symbol used to represent brand.
- Trade secret: The main secret principle or philosophy of running unique business.
- Hacker: The person who enter into other system without proper authorization.
Unit 3: Computer Security
Computer security and its types
Define computer security? Mention its type.
The protection or securing computer data, information, software and hardware from being damaged or lost is known as computer security. Its types are:
- Hardware security
- Software security
Define hardware security? Give any four measures to protect the computer hardware.
The protection or securing computer from physical damage or loss is known as hardware security. It deals with protection of computer hardware components and its peripheral. Following are the measures of hardware security.
- Regular maintenance
- Dust free environment
- Insurance
- Protection from fire
- Protection from theft
- Power protection device
- Air conditioning.
Define software security? Give any four measures to protect the computer software.
The protection or securing computer data, information and software being damaged or lost knowingly or unknowingly is known as computer security.
- Measures of software security
- Keeping password
- Backup
- Use of antivirus
- Fragmentation
- Scandisk
Important Terms
- SMPS: Switch Mode Power Supply
- CVT: Constant Voltage Transformer
- CCTV: Close Circuit Television
- Password: Secret word used to prevent unauthorized access
- Backup: Duplicate copies of original data file, so that we can access even original data gets lost or damaged.
- Fragmentation: The process of scattering part of same disk over random location
- Defragmentation: The process of rewriting part of file to a contiguous sector on a disk. It increase disk access speed i.e increase disk performance.
- Scandisk: Repairing harddisk.
- Antivirus: Software use to detect and eliminate virus from our computer system. Eg, AVG, Norton, NOD32, Kaspersky etc
- Power protection device: UPS, Volt guard, Spike guard, CVT
- UPS: Un-interruptable Power Supply provides power backup when there is electric power failure.
- Volt guard/CVT: They regulate incoming voltage and maintain uniform power supply. They do not provide backup power.
Computer virus its effect and cause
Computer virus: It is a computer program that replicates(multiplies) itself and destroys data, files and program of our computer system. Types of computer virus
- Boot sector: Infects master boot record (MBR) of our computer system. (Booting refers to starting of computer system)
- File infector or program infector virus: Infect programs or executable files (.exe, .dmg, installer files)
- Multipartite virus: Infects both boot sector and application programs.
- Macro virus: Infects certain files created using macros such as MS-Word, MS-Excel etc
- Stealth virus: Which can hide from being detected. Its hard to detect
- Trojan horse: They does not replicate but are installed once then it starts malfunctioning.
- WORM: Write Once Read Many
Purpose of creating virus:
- To expose programming ability.
- To protect software piracy.
- To destroy data and information.
- To entertain user.
- To hack and crack software.
Causes of computer virus/Reason of transmission
- Exchanging data and files from other computer.
- Opening spams and links on network
- Using pirated software.
- Sharing computer drives and storage.
- Using unauthorized web application.
Ill-Effects/Symptoms of computer virus
- Program takes longer time to load.
- Unwanted message appears in the screen.
- Change in file size and directory.
- Corrupts system data and files.
- Computer boots frequently unnecessarily.
Precaution/Safety measure/Protection of computer virus
- Use updated antivirus.
- Don’t open unauthorized mails and link on internet.
- Don’t use pirated software.
- Back up data, files and folders if necessary.
- Use password when not in use.
- Don’t share files and folders from infected computer.
Antivirus: It is an utility software that helps to detects and eliminates computer virus from the computer. For eg, AVG (Antivirus Guard), NOD 32, Norton, Kaspersky, Panda antivirus, PC-Cillin, Avast etc
Unit 4: E-Commerce
E-Commerce and its types
E-Commerce: The process of buying and selling goods, services and information through internet is called E-Commerce. It basically refers to electronic transaction done over a communication network i.e. internet.
Note: E-mail, Fax, Online payment, Online Security, Web services, Information sharing are some the widely used technology in E-Commerce
Types of E-Commerce:
a) Business to Customer (B2C): The business relationship between business organization and final customer. E-Commerce website plays intermediary role between business organization and final consumer. amazon performs B2C.
b) Business to Business (B2B): This type of e-commerce is conducted between companies. Individual consumer cannot buy from this type of e-commerce. For example, manufacturing companies sells goods to wholesalers. alibaba performs B2B.
c) Consumer to Consumer (C2C): This type of e-commerce is conducted between consumers. For example, second hand or used products can also be brought online using site like hamrobazaar. These platforms acts as a third-party where consumers can directly interact with each other and can perform transaction between them.
Pros and Cons of E-Commerce
Advantage / Pros / Merits of E-Commerce
- We can buy and sell goods and services anytime anywhere.
- No geographical limitations, we can expand our business globally.
- Physical store and shops are not required.
- Low operation cost.
- Customers will have wide range of choice.
- Customers can provide real time feedback and suggestion.
Disadvantage / Cons/ De-merits / Limitation of E-Commerce
- Its works only on network such as internet.
- Chances of electronic frauds and scam.
- Technical failure may hamper whole business operation.
- Technical skill and knowledge require to operate.
- Goods and services may not be real as shown in the e-commerce.
- International laws may restrict to perform business overseas.
Similarities and Differences between Traditional Commerce and E-commerce.
Traditional Commerce VS E-Commerce | |
Similarities | Differences |
Both are profit oriented. | Unlike traditional, E-Commerce used Internet based technologies. |
Both wants to expand and serve large number of consumer. | Unlike traditional, E-Commerce can provide global audience. |
Both wants good relationship among consumers | Unlike traditional, In E-Commerce physical stores and human intervention is not required. |
Both want to deliver quality services to consumers. | Unlike traditional, E-Commerce can provide real time feedback and criticism. |
Some important terminologies
a) M-Commerce: It refers to Mobile-Commerce which is an extended version of e-commerce where buying and selling goods, services and information are done through handheld devices such as mobile phone, tablets, PDAs etc. M-Commerce includes website and mostly apps that provide features of performing transaction. Some example of M-Commerce are: purchasing airline tickets, movie tickets, hotel booking, top-up recharge, fund transfer etc.
Importance of M-Commerce:
- Widely used technology. Almost every people in this days used mobile phone.
- Portable enough to perform transaction anytime anywhere.
b) Online payment: Online payment is the process of performing transaction without using cash. It generally refers to paper less transaction using modern days solution i.e. payment gateway. through internet. Several modes of E-payments are: credit card, debit card, electronic fund transfer (EFT), E-cheque etc.
Advantages of Online payment:
- Cash less/paper less transaction.
- Great safety and security from physical theft.
- Virtual fund transfer minimizes human interaction
- Can be used to perform online shopping.
Unit 5: Contemporary technology
Contemporary Technology refers to the latest innovation and technology that has become a part of our daily life. These technologies has great influence over a life of human. Services like E-mail, E-Commerce, Chats, Video Conferencing, Live streaming are some of the common contemporary technology that we encounter on daily basis.
Beside above mentioned some integrated latest technologies are:
- Cloud computing: Cloud generally refers to huge collection of storage which are done through server farms. The trend of using a network of remote servers/data center hosted on the internet to store, manage, and process data, rather than in our local server or a personal computer is called cloud computing. Google Drive, one drive, iCloud are an example of cloud storage.
Advantages of Cloud Computing
- Large volume of data can be stored conveniently.
- It helps in data backup and recovery.
- Cloud computing services are used to host live-streaming.
- High speed of data transfer.
2. Mobile Computing: The use of handheld devices such as mobile phone and tablets to transfer data, voice and video over a network is called mobile computing. These technology allows people to access data and information from whenever and wherever they are.
Advantages of Mobile Computing.
- They are highly portable and be used from anywhere around.
- Mobiles and other handheld devices can be connected in a network to exchange data and information
3. E-Governance: The set of services provided by the government to their public through electronics means specially internet is called E-Governance.
Advantages of E-Governance
- It increase public participation.
- It increase transparency in governmental activities.
- It reduces corruptions.
- Helps to make paperless government.
- Easy and fast delivery of governmental services.
4. Artificial Intelligence: Artificial Intelligence is an emerging branch in computer science, which interprets the means and method of making computers think like human beings. In short, It is process of integrating human behavior in machine.
Machine learning, Robotics, cyber security, health care etc are the application areas of AI.
Advantages of AI:
- It handles data and information better than human.
- It introduces new methods to solve problems.
- It can be used in decision making.
- It can be to interpret data and draw conclusion.
- AI robots can be used to solve complex engineering problems.
5. Virtual Reality: It is an artificial environment created by using the computers and technology to give user a realistic experience. In short it is a simulated environment created using computerized technology. It creates an illusion of the real world. VR are used in film industry, gaming, aviation industry etc.
Advantages of VR:
- It can create realistic environment and experience.
- Simulation of complex problem. eg, Pilot learns their first flying experience in simulated environment.
- It make gaming much more realistic and engaging.
6. Internet of Things (IOT): IoT are the electronic technology in which devices can communicate with user and its environment in real time. These devices can share data and information between user and its server allowing user to experience the combination of physical world with digital.
In general IoT is the network of real world “Things” (devices) made with sensors, software and other various technology that can communicate with user and devices through internet.
Modern days devices like smart watch can track our fitness level, voice assistant in our mobile phones like Siri and Alexa, smart car like Tesla built with autonomous riding capability, home security system that allows to monitor suspicious activities and more.
Advantages of IoT
- It increases efficiency and productivity of work.
- It helps to automate our daily life work.
- It can be used as entertainment enhancing user experience.
- It helps to communicate and exchange data and information in real time.
Unit 6: Number system
Altogether from number system 4 marks question will be asked. 2 numerical will be from Number system conversion whereas 2 numerical will be from Binary operation i.e Binary addition, subtraction, multiplication and division.
All the possible problem are solved in the given video link.
Click here for all problem of Number system conversion – 2 marks
Click here for all problem of Binary operation – 2 marks
Unit 7: DBMS
Data and information
Data: Data are the raw facts and figure with are isolated and uninterpreted generally represented by letter and numbers. Data undergoes processing. Eg, 32, John, 12
Information: The collection of meaningful result obtained after processing raw data. They are generated after processing. Eg. John is 32 years old and he reads in class 12.
Database: The systematic and scientific collection of data that can access quickly whenever required is called database. It is the organized way of collecting and keeping data and information. E.g. Dictionary, telephone directory, marks ledger, attendance register.
DBMS and its advantages
DBMS: DBMS stands for Database Management System which is the collection of software that is used to manages database i.e. storing, manipulating and retrieving data systematically and scientifically. It is a software used to store, process and access data and information whenever required. Eg, MS-Access, MY SQL, Oracle, dBase, Foxpro
Advantages of DBMS.
- It helps in faster access of data.
- It helps to reduce duplication of data.
- It helps to provide security and privacy to data.
- It helps in data sharing.
- Easy to modify the data
Q) Differentiate between database and DBMS with examples. [V.imp]
Database | DBMS |
It is collection of related data. | It is a software to maintain database. |
It is not secured. | It is highly secured. |
Data sharing is impossible. | Data can be easily share in a network |
Every DBMS has database. | Every database doesn’t have DBMS. |
Eg, Dictionary, telephone directory | Eg, MY SQL, Oracle. |
MS-Access: It is a DBMS developed by Microsoft corporation for organizing data in the form of tables. It allows user to add, edit, delete, sort, modify, share and print records. Feature of MS-Access.
- Easy to store data and information.
- Easy to enter, edit, delete and display data.
Objects / Element of DBMS
A) Table: The primary building block of DBMS where data are organized in the tabular form i.e rows and columns. The columns of database table are called field whereas, rows are called record. Importance of table.
- Helps to store data in organized group.
- Easy to sort distinct records.
- Fields of table helps to store different types of datas on different topic.
B) Form: The element/object of database which allows user to enter new datas and edit the existing one easily through user friendly interface. Importance of form.
- It provide user interface through which user can enter data.
- It helps to modify records.
C) Query: The importance object of database which is used to retrieve/access and interpret the information according the user requirement. Importance of query.
- It helps in faster access of data.
- It helps to display information as per the users condition.
- It helps in sorting and filtering of data.
Types of Query
- Select query: Used to retrieve data from one or more table depending upon the condition.
- Action Query: Used to make changes to records available in database. Types are
- Update query: Used to make global (All at once) changes to several records in different table.
- Append query: Used to add more records in existing one or more tables.
- Delete query: Used to delete one or more record from one or more tables.
- Make-table query: Create new table link one or more available tables in database/
D) Report: The object of database which is used to generate result after processing data in a database. It is the effective way of displaying data either in soft copy (monitor) format or hard copy (printed) format. Important of report.
- It helps to generate summary after processing data.
- It can be used to generate invoice, bills, statement and labels.
- It helps to generate result in attractive and effective way.
Data types: The characteristics of field that specifies what kind of data can be stored in the given field is called data types. Following are the data types used in MS-Access.
S.N | Data Type | Purpose/use | Size |
1. | Text | Alphanumeric characters | 0-255 characters / 256 characters |
2. | Memo | Alphanumeric characters | 0-65,535 characters / 65,536 characters |
3. | Number | Numeric Values | Integer (2 bytes) Long integer (4 bytes) |
4. | Date/Time | Date and time data | 8 bytes |
5. | Currency | Currency data | 8 bytes |
6. | Auto-number | A sequential unique serial number automatically increased by 1 | 4 bytes |
7. | Yes/No | Logical Values | 1 bit |
8. | OLE object (Object Link Embedded) | Pictures, audio, video, graphics, documents | 1GB |
9. | Hyperlink | Link with several applications and websites | 2048 characters |
10. | Look Wizard | Create a field that allows to select a value. | 4 bytes |
Field properties
- Field size: It is used to set the maximum size for the data stored in a given field. For eg, maximum characters (size) store in text field is 256 characters. Default field size is 50.
- Format: It is used to display formatted output that means data can be display in different formats and layouts. For eg, < (Display content in lower case), > (Display content in upper case).
- Input mask: It is used to specify the format in which data can be entered.
- Caption: It is used to display alternate name for the field to make it more descriptive. It can contain 2048 characters.
- Default value: It is the value or information that is displayed automatically when we add a new record in table for a field.
- Validation rule: It enables user to limit values that can be accepted by particular field. It can contain 2048 characters.
- Validation text: The message that is displayed when validation rule is violated or not followed.
- Required: It is used to specify whether the data must be enter or not in the particular field.
- Indexed: It is used to speed up the searching and sorting of record from the database table.
Some important terms used in DBMS
1) Extension of MS-Access database file is .MDB
2) Primary key(v.imp): The key or field that is used to uniquely identified records from the database table is called primary key. It must be unique and cannot be kept empty(null). Importance of primary key.
- It uniquely identifies records.
- It helps in faster access of data.
- It helps to prevent duplication of data.
- It avoids empty(null) values.
- It is used to establish table relationship.
3) Table relationship: The logical link between two or more than two tables of database using unique key fields is called table relationship. Types are: one to one, one to many, many to many.
4) Sorting: Arranging data in a particular order of field i.e. ascending or descending is called sorting. Helps in faster access of data.
5) Filtering: The process of making selection of record depending upon the supplied criteria is called filtering. Helps in faster access of data.
6) DBA: DBA stands for Database Administrator is a person or specialist who is responsible to manages and monitor overall resources and operation (such as analyzing, planning, operating, implementing and securing) associated with DBMS. Responsibilities of DBMS.
- Planning database activities.
- Securing database and system.
- Implementing modern tools and technology..
- Maintaining database.
- Providing user safety and privacy.
Unit 8.1: Series using SUB Procedure
Click here for QBASIC theory notes
Click here for Series and patterns using FUNCTION … END FUNCTION
Click here for SEE repeated Find output with solution.
Generate following series using Sub …. End Sub.
- Fibonacci series i.e. 0 1 1 2 3 5 8 …………..20th term
DECLARE SUB SERI()
CLS
CALL SERI
END
SUB SERI
a=0
b=1
PRINT a;b;
FOR i=1 to 20
c=a+b
print c;
a=b
b=c
NEXT i
END SUB
- 1 2 3 6 11 20 ….10th term
declare sub series ( )
CLS
CALL series
END
SUB series
a = 1
b = 2
c = 3
PRINT a; b; c;
FOR i = 1 TO 10
d = a + b + c
PRINT d;
a = b
b = c
b = d
NEXT i
END SUB
- 1 2 4 7 11 ……………10th term
DECLARE SUB SERI()
CLS
CALL SERI
END
SUB SERI
a=1
g=1
FOR i=1 to 10
print a
a=a+g
g=g+1
NEXT i
END SUB
- 1 2 5 10 17 …………..10th term
DECLARE SUB SERI()
CLS
CALL SERI
END
SUB SERI
a=1
g=1
FOR i=1 to 10
print a
a=a+g
g=g+2
NEXT i
END SUB
- 3 12 27 48 …………….10th term
DECLARE SUB SERI()
CLS
CALL SERI
END
SUB SERI
FOR i=1 to 10
a= 3*i^2
PRINT a;
NEXT i
END SUB
- 1 5 25 125 ………..7th term
DECLARE SUB SERI()
CLS
CALL SERI
END
SUB SERI
FOR i=0 to 6
a= 5^i
PRINT a;
NEXT i
END SUB
- 5 10 20 35 55 …………….10th term
DECLARE SUB SERI()
CLS
CALL SERI
END
SUB SERI
a=5
g=5
FOR i=1 to 10
print a
a=a+g
g=g+5
NEXT i
END SUB
Write all the following programs using only Sub….End Sub.
- To convert given second into respective hour, minute and second.
Declare sub convert (s)
CLS
INPUT “Enter second”;s
call convert (s)
end
sub convert (s)
h =s\3600
rs = s MOD 3600
m = rs\60
sec = rs MOD 60
Print “Hour";h; “Minute”;m; “Second”;sec
End Sub
2. To display and count all the vowels and consonant from the given string.
DECLARE SUB COUNT (N$)
CLS
INPUT "Enter any string"; N$
CALL COUNT (N$)
END
SUB COUNT (N$)
FOR I = 1 TO LEN(N$)
X$ = MID$(N$,I,1)
X$ = UCASE$(X$)
IF X$ = "A" AND X$ = "E" AND X$ = "I" AND X$ = "O" AND X$ = "U" THEN
V = V+1
ELSE
C=C+1
END IF
NEXT I
PRINT "Total numbers of vowels ="; V
PRINT "Total numbers of consonants ="; C
END SUB
3. To display all the factors of given number.
Declare sub factors (n)
cls
Input “ Enter number” ;n
call factors (n)
end
sub factors (n)
for i = 1 to n
If n MOD i = 0 then
print ;i
end if
next i
end sub
4. To display first 10 multiples of given number.
Declare sub multiple (n)
cls
Input “ Enter number” ;n
call multiple (n)
end
sub multiple (n)
for i = 1 to 10
m=n*i
print m;
next i
end sub
Unit 8.2: SUB and FUNCTION [ QBASIC programs ]
QBASIC programming altogether covers 18 out of 50 marks in SEE examination. QBASIC programming grid for SEE is as follows.
Group C “QBASIC programming” 18 marks
S.N | Questions type | No. of ques. | Each ques. marks | Tot. marks |
1 | Questions and answer | 3 | 1 | 3 |
2 | Find the output | 1 | 2 | 2 |
3 | Debug the program | 1 | 2 | 2 |
4 | Read program and answer the questions | 1 | 2 | 2 |
5 | Write a program using Sub….End Sub | 1 | 3 | 3 |
6 | Write a program using Function….End Function | 1 | 3 | 3 |
7 | Write a program from File handling | 1 | 3 | 3 |
Total marks | 18 |
Some QBASIC programming practice questions for SEE.
Write all the following programs using both Sub….End Sub and Function…..End Function.
1) To convert Celsius temperature scale into Fahrenheit temperature scale. [ (C-0)/100 =(F-32)/180 ]
DECLARE SUB TEMP (C)
CLS
INPUT "Enter temperature in Celsius";C
CALL TEMP (C)
END
SUB TEMP (C)
F = (18*C+320)/10
PRINT "Equivalent Fahrenheit temperature is";F
END SUB
DECLARE FUNCTION TEMP (C)
CLS
INPUT "Enter temperature in Celsius";C
X = TEMP (C)
PRINT "Equivalent Fahrenheit temperature is";X
END
FUNCTION TEMP (C)
F= (18*C+320)/10
TEMP = F
END FUNCTION
2) To convert Nepali rupee into Indian currency . [ 1IC = 1.6Rs ]
DECLARE SUB CONVERT (N)
CLS
INPUT "Enter Nepali Rupee";N
CALL CONVERT (N)
END
SUB CONVERT (N)
IC = N/1.6
PRINT "Equivalent Indian currency is";IC
END SUB
DECLARE FUNCTION CONVERT (N)
CLS
INPUT "Enter Nepali Rupee";N
X = CONVERT (N)
PRINT "Equivalent Indian currency is";X
END
FUNCTION CONVERT (N)
IC = N/1.6
CONVERT = IC
END FUNCTION
3) To calculate sum of n-natural number.
DECLARE SUB SUM (N)
CLS
INPUT "Enter Number";N
CALL SUM (N)
END
SUB SUM (N)
FOR I = 1 TO N
S = S+I
NEXT I
PRINT "Sum is:" ; S
END SUB
DECLARE FUNCTION SUM (N)
CLS
INPUT "Enter Number";N
X = SUM (N)
PRINT "Sum is:" ; X
END
FUNCTION SUM (N)
FOR I = 1 TO N
S = S+I
NEXT I
SUM = S
END FUNCTION
4) To calculate factorial of given number. (Product of N-natural number)
DECLARE SUB FACT (N)
CLS
INPUT "Enter Number";N
CALL FACT (N)
END
SUB FACT (N)
F=1
FOR I = 1 TO N
F = F*I
NEXT I
PRINT "Factorial is:" ; F
END SUB
DECLARE FUNCTION FACT (N)
CLS
INPUT "Enter Number";N
X = FACT (N)
PRINT "Factorial is:" ; X
END
FUNCTION FACT (N)
F=1
FOR I = 1 TO N
F = F*I
NEXT I
FACT = F
END FUNCTION
5) To calculate average of three numbers.
DECLARE SUB AVG (a,b,c)
CLS
INPUT "Enter Three Number"; a,b,c
CALL AVG (a,b,c)
END
SUB AVG (a,b,c)
av = (a+b+c)/3
PRINT "Average is"; av
END SUB
DECLARE FUNCTION AVG (a,b,c)
CLS
INPUT "Enter Three Number"; a,b,c
X = AVG (a,b,c)
PRINT "Average is"; X
END
FUNCTION AVG (a,b,c)
av = (a+b+c)/3
AVG = av
END FUNCTION
6) To find longest string among three strings.
DECLARE SUB LONG (a$,b$,c$)
CLS
INPUT "Enter three string"; a$,b$,c$
CALL LONG (a$,b$,c$)
END
SUB LONG (a$,b$,c$)
a = LEN(a$)
b = LEN(b$)
c = LEN(c$)
IF a>b AND a>c THEN
PRINT "Longest string is"; a$
ELSEIF b>a AND b>c THEN
PRINT "Longest string is"; b$
ELSE
PRINT "Longest string is"; c$
END IF
END SUB
DECLARE FUNCTION LONG$ (a$,b$,c$)
CLS
INPUT "Enter three string"; a$,b$,c$
X$ = LONG$ (a$,b$,c$)
PRINT "Longest string is"; X$
END
SUB LONG (a$,b$,c$)
a = LEN(a$)
b = LEN(b$)
c = LEN(c$)
IF a>b AND a>c THEN
LONG$ = a$
ELSEIF b>a AND b>c THEN
LONG$ = b$
ELSE
LONG$ = c$
END IF
END SUB
7) To check whether given number is positive, negative or zero.
DECLARE SUB CHECK (N)
CLS
INPUT "Enter any Number"; N
CALL CHECK (N)
END
SUB CHECK (N)
IF N>0 THEN
PRINT ;N; "is positive"
ELSEIF N<0 THEN
PRINT ;N; "is negative"
ELSE
PRINT ;N; "is zero"
END IF
END SUB
DECLARE FUNCTION CHECK$ (N)
CLS
INPUT "Enter any Number"; N
x$ = CHECK$ (N)
PRINT X$
END
FUNCTION CHECK$ (N)
IF N>0 THEN
CHECK$ = "Positive"
ELSEIF N<0 THEN
CHECK$ = "Negative"
ELSE
CHECK$ = "Zero"
END IF
END FUNCTION
8) To calculate sum of digits of given number.
DECLARE SUB SUM (N)
CLS
INPUT "Enter any Number"; N
CALL SUM (N)
END
SUB SUM (N)
WHILE N <>0
R = N MOD 10
S = S+R
N = N\10
WEND
PRINT "Sum is"; S
END SUB
DECLARE FUNCTION SUM (N)
CLS
INPUT "Enter any Number"; N
X = SUM (N)
PRINT "Sum is"; X
END
FUNCTION SUM (N)
WHILE N <>0
R = N MOD 10
S = S+R
N = N\10
WEND
SUM = S
END SUB
9) To calculate product of digits of given number.
DECLARE SUB PRODUCT (N)
CLS
INPUT "Enter any Number"; N
CALL PRODUCT (N)
END
SUB PRODUCT (N)
P = 1
WHILE N <>0
R = N MOD 10
P = P*R
N = N\10
WEND
PRINT "Product is"; P
END SUB
DECLARE FUNCTION PRODUCT (N)
CLS
INPUT "Enter any Number"; N
X = PRODUCT (N)
PRINT "Product is"; X
END
FUNCTION PRODUCT (N)
P = 1
WHILE N <>0
R = N MOD 10
P = P*R
N = N\10
WEND
PRODUCT = P
END FUNCTION
10) To check whether the given number is palindrome or not. [1221 is palindrome]
DECLARE SUB PALIN (N)
CLS
INPUT "Enter any Number"; N
CALL PALIN (N)
END
SUB PALIN (N)
Z = N
WHILE N <>0
R = N MOD 10
S = S*10+R
N = N\10
WEND
IF Z=S THEN
PRINT ;N; "is Palindrome"
ELSE
PRINT ;N; "is not Palindrome"
END IF
END SUB
DECLARE FUNCTION PALIN$ (N)
CLS
INPUT "Enter any Number"; N
X$ = PALIN$ (N)
PRINT ; X$
END
FUNCTION PALIN$ (N)
Z = N
WHILE N <>0
R = N MOD 10
S = S*10+R
N = N\10
WEND
IF Z=S THEN
PALIN$ = "Given number is Palindrome"
ELSE
PALIN$ = "Given number is not Palindrome"
END IF
END FUNCTION
11) To check whether the given number is armstrong or not. [153 is armstrong]
DECLARE SUB ARM (N)
CLS
INPUT "Enter any Number"; N
CALL ARM (N)
END
SUB ARM (N)
Z = N
WHILE N <>0
R = N MOD 10
S = S+Rˆ3
N = N\10
WEND
IF Z=S THEN
PRINT ;N; "is Armstrong"
ELSE
PRINT ;N; "is not Armstrong"
END IF
END SUB
DECLARE FUNCTION ARM$ (N)
CLS
INPUT "Enter any Number"; N
X$ = ARM$ (N)
PRINT ; X$
END
FUNCTION ARM$ (N)
Z = N
WHILE N <>0
R = N MOD 10
S = S+Rˆ3
N = N\10
WEND
IF Z=S THEN
ARM$ = "Given number is Armstrong"
ELSE
ARM$ = "Given number is not Armstrong"
END IF
END FUNCTION
12) To check whether the given number is prime or composite.
DECLARE SUB CHECK (N)
CLS
INPUT "Enter any Number"; N
CALL CHECK (N)
END
SUB CHECK (N)
FOR I = 1 TO N
IF N MOD I = 0 THEN
C = C+1
END IF
NEXT I
IF C = 2 THEN
PRINT ;N: "is Prime"
ELSE PRINT ;N: "is Composite"
END IF
END SUB
DECLARE FUNCTION CHECK$ (N)
CLS
INPUT "Enter any Number"; N
X$ = CHECK$ (N)
PRINT X$
END
FUNCTION CHECK$ (N)
FOR I = 1 TO N
IF N MOD I = 0 THEN
C = C+1
END IF
NEXT I
IF C = 2 THEN
CHECK$ = "Given number is Prime"
ELSE
CHECK$ = "Given number is Composite"
END IF
END FUNCTION
13) To calculate sum of even digits from a given number.
DECLARE SUB SUM (N)
CLS
INPUT "Enter any Number"; N
CALL SUM (N)
END
SUB SUM (N)
WHILE N <>0
R = N MOD 10
IF R MOD 2 = 0 THEN
S = S+R
END IF
N = N\10
WEND
PRINT "Sum of even digits is"; S
END SUB
DECLARE FUNCTION SUM (N)
CLS
INPUT "Enter any Number"; N
X = SUM (N)
PRINT "Sum of even digits is"; X
END
FUNCTION SUM (N)
WHILE N <>0
R = N MOD 10
IF R MOD 2 = 0 THEN
S = S+R
END IF
N = N\10
WEND
SUM = S
END SUB
14) To calculate product of odd digits from a given number.
DECLARE SUB PRODUCT (N)
CLS
INPUT "Enter any Number"; N
CALL PRODUCT (N)
END
SUB PRODUCT (N)
P = 1
WHILE N <>0
R = N MOD 10
IF R MOD 2 = 1 THEN
P = P*R
END IF
N = N\10
WEND
PRINT "Product of odd digits is"; P
END SUB
DECLARE FUNCTION PRODUCT (N)
CLS
INPUT "Enter any Number"; N
X = PRODUCT (N)
PRINT "Product of odd digits is"; X
END
FUNCTION PRODUCT (N)
P = 1
WHILE N <>0
R = N MOD 10
IF R MOD 2 = 1 THEN
P = P*R
END IF
N = N\10
WEND
PRODUCT = P
END FUNCTION
15) To check whether the given string is palindrome or not. [ MADAM is palindrome]
DECLARE SUB PALIN (N$)
CLS
INPUT "Enter any string"; N$
CALL PALIN (N$)
END
SUB PALIN (N$)
FOR I = LEN(N$) TO 1 STEP -1
X$ = MID$(N$,I,1)
W$ = W$+X$
NEXT I
IF N$=W$ THEN
PRINT ;N$; "is Palindrome"
ELSE
PRINT ;N$; "is not Palindrome"
END IF
END SUB
DECLARE FUNCTION PALIN$ (N$)
CLS
INPUT "Enter any string"; N$
A$ = PALIN$ (N$)
PRINT A$
END
FUNCTION PALIN$ (N$)
FOR I = LEN(N$) TO 1 STEP -1
X$ = MID$(N$,I,1)
W$ = W$+X$
NEXT I
IF N$=W$ THEN
PALIN$ = "Given string is Palindrome"
ELSE
PALIN$ = "Given string is not Palindrome"
END IF
END FUNCTION
16) To input a string and count how many times the first letter of the same string repeats. [ ie. BABY B repeats 2 times ]
DECLARE SUB COUNT (N$)
CLS
INPUT "Enter any string"; N$
CALL COUNT (N$)
END
SUB COUNT (N$)
A$ = LEFT$(N$,1)
FOR I = 1 TO LEN(N$)
X$ = MID$(N$,I,1)
IF A$ = X$ THEN
C = C+1
END IF
NEXT I
PRINT "First letter repeats = "; C
END SUB
DECLARE FUNCTION COUNT (N$)
CLS
INPUT "Enter any string"; N$
X = COUNT (N$)
PRINT "First letter repeats = "; X
END
FUNCTION COUNT (N$)
A$ = LEFT$(N$,1)
FOR I = 1 TO LEN(N$)
X$ = MID$(N$,I,1)
IF A$ = X$ THEN
C = C+1
END IF
NEXT I
COUNT = C
END FUNCTION
17) To count total numbers of vowels in a given string.
DECLARE SUB COUNT (N$)
CLS
INPUT "Enter any string"; N$
CALL COUNT (N$)
END
SUB COUNT (N$)
FOR I = 1 TO LEN(N$)
X$ = MID$(N$,I,1)
X$ = UCASE$(X$)
IF X$ = "A" OR X$ = "E" OR X$ = "I" OR X$ = "O" OR X$ = "U" THEN
C = C+1
END IF
NEXT I
PRINT "Total numbers of vowels ="; C
END SUB
DECLARE FUNCTION COUNT (N$)
CLS
INPUT "Enter any string"; N$
X = COUNT (N$)
PRINT "Total numbers of vowels ="; X
END
FUNCTION COUNT (N$)
FOR I = 1 TO LEN(N$)
X$ = MID$(N$,I,1)
X$ = UCASE$(X$)
IF X$ = "A" OR X$ = "E" OR X$ = "I" OR X$ = "O" OR X$ = "U" THEN
C = C+1
END IF
NEXT I
COUNT = C
END SUB
18) To display all the consonant from a given string.
DECLARE SUB COUNT (N$)
CLS
INPUT "Enter any string"; N$
CALL COUNT (N$)
END
SUB COUNT (N$)
FOR I = 1 TO LEN(N$)
X$ = MID$(N$,I,1)
X$ = UCASE$(X$)
IF X$ = "A" OR X$ = "E" OR X$ = "I" OR X$ = "O" OR X$ = "U" THEN
ELSE
W$ = W$+x$
END IF
NEXT I
PRINT W$
END SUB
DECLARE FUNCTION DISPLAY$ (N$)
CLS
INPUT "Enter any string"; N$
A$ = DISPLAY$ (N$)
PRINT A$
END
FUNCTION DISPLAY$ (N$)
FOR I = 1 TO LEN(N$)
X$ = MID$(N$,I,1)
X$ = UCASE$(X$)
IF X$ = "A" OR X$ = "E" OR X$ = "I" OR X$ = "O" OR X$ = "U" THEN
ELSE
W$ = W$+x$
END IF
NEXT I
DISPLAY$ = W$
END FUNCTION
19) To display given string into alternative capital and small letters. [ NePaL ]
DECLARE SUB ALTER (N$)
CLS
INPUT "Enter any string"; N$
CALL ALTER (N$)
END
SUB ALTER (N$)
FOR I = 1 TO LEN(N$)
X$ = MID$(N$,I,1)
IF I MOD 2 = 0 THEN
X$ = LCAES$(X$)
ELSE
X$ = UCAES$(X$)
END IF
W$ = W$ + X$
NEXT I
PRINT W$
END SUB
DECLARE FUNCTION ALTER$ (N$)
CLS
INPUT "Enter any string"; N$
A$ = ALTER$ (N$)
PRINT A$END
FUNCTION ALTER$ (N$)
FOR I = 1 TO LEN(N$)
X$ = MID$(N$,I,1)
IF I MOD 2 = 0 THEN
X$ = LCAES$(X$)
ELSE
X$ = UCAES$(X$)
END IF
W$ = W$ + X$
NEXT I
ALTER$ = W$
END SUB
Unit 8.3: QBASIC File handling
Important program from QBASIC File handling for SEE class 10. [Click here for answers]
- Write a program to create a sequential data file named “record.txt” and store Roll number, Name, Address and Class of a student.
- Write a program to create a sequential data file named “record.txt” and store Roll number, Name, Address and Class of few students.
- Write a program to add few more record in a data file named “record.txt” which contains Roll number, Name, Address and Class of few students.
- Write a program to display all the records from data file named “record.txt” which contains Roll number, Name, Address and Class of several students.
- Write a program to display only those records whose name starts with “K” from data file named “record.txt” which contains Roll number, Name, Address and Class of several students.
- Write a program to display only those records who lives in “POKHARA” from data file named “record.txt” which contains Roll number, Name, Address and Class of several students.
- Write a program to count and display only those records who reads in class 10 from data file named “record.txt” which contains Roll number, Name, Address and Class of several students.
- Write a program to display only those records whose roll number is in from 20 to 30 from data file named “record.txt” which contains Roll number, Name, Address and Class of several students.
- Write a program to count only those records who doesn’t lives in “POKHARA” from data file named “record.txt” which contains Roll number, Name, Address and Class of several students.
- Write a program to delete all those records whose address is “KATHMANDU”from data file named “record.txt” which contains Roll number, Name, Address and Class of several students.
Q) A sequential data file named “result.doc” contains Roll number, Name, Class and Marks obtained in 5 different subject i.e Maths, Science, English, Nepali, Computer. Let us consider Pass mark to be 40 and Full mark to be 100 then answer all the following questions.
- Write a program to display all the name of students who failed in any one or more of the subject.
- Write a program to count total number of students who passed in all the subject.
- Write a program to calculate and display percentage of all the students along with the roll number and name.
- Write a program to display name of the students who failed only in English and Nepali.
- Write a program to delete all the records of students who failed in any one or more of the subject.