SEE Computer Science 2079 Notes.
SEE Computer Science 2079 Notes.
Telecommunication
Telecommunication is a system of transmission of sounds, images, texts or data in the form of electronic
signals.
Data Communication
Data communication is a process of transferring data electronically from one place to other using different
transmission mediums. E.g. E-Mail, Chat and phone calls.
Medium
A path through which the sender makes communication to the receiver is known as medium.
Protocol
Protocol is a set of rules by which computers on the network communicate with each other.
E.g., TCP/IP, SMTP, HTTP etc.
Simplex mode
The transmission mode in which transmission of data can take place in one direction only is called simplex
mode.
E.g.: Newspaper, Radio and Television.
Bandwidth
Bandwidth can be defined as the maximum volume of data that can be transmitted through a
communicationsystem.
We can measure bandwidth in digital devices by bits per second and in analogue devices by cycles per
second or Hertz (Hz).
Guided medium
The transmission media which comprises of cables or wires through which data is transmitted is called
guided medium. They are called guided since they provide a physical channel from the sender device to
the receiver device. The signal travelling through these media are bounded by the physical limits of the
medium.
E.g.: twisted pair cable, co-axial cable, fiber optics cable, etc.
Unguided medium
The transmission media which transfer data in the form of electromagnetic waves that do not require
any cables for transmission is called unguided medium. These media are bounded by geographical
boundaries.
E.g.: radio wave, microwave, infrared etc.
Co-axial cable
Coaxial (or “coax”) cable is a common type of cable used for transmitting data over long distances.
Theyare most commonly used to transmit cable TV and Internet signals.
The connectors used with co-axial cables are BNC, T-connectors and terminators in bus
topology.10 bps is the maximum speed of co-axial cable.
3
Edited by: Krishna Sir. Developed by: Deepak Sir.
Microwave transmission
Microwave is a line-of-sight wireless communication technology that uses high frequency beams of
radiowaves to provide high speed wireless connections that can send and receive voice, video, and data
information.
Microwaves do not pass-through buildings. So, indoor receivers cannot be used
effectively.It provides higher bandwidth for data communication.
It requires line of sight for data transmission.
Infrared transmission
Infrared Transmission is the transmission of data or voice information over infrared (IR) light over
shortranges.
It requires line-of-sight and is unable to break through walls.
Computer network
A computer network means two or more computers connected with each other to share data, hardware,
software and other resources.
4
Edited by: Krishna Sir. Developed by: Deepak Sir.
Unix etc.Different types of servers are file server, print server, application server etc.
Workstation
Workstation is a computer network that utilizes network resources. Network operating software used by
workstation are Windows 98, Windows XP etc.
Node
Each computer or device of network is called node.
Router
Router is an intelligent device that connects two different networks which uses the address for filtering and
forwarding the data as well as it has an ability to determine the best route for destination.
Cable
Cables are commonly used media of physical channel for transmitting data between computers in network.
Examples of cables are coaxial, twisted pair and fiber optic cable.
Connector
Connector is an interface between the NIC of the computer and the cable that passes data between
computers in network. Examples of connectors are BNC used with coaxial cable, RJ 45 used with
UTPcable, ST used with fiber optic cable etc.
Hub
A hub is a network device with multiple points or ports which acts as a central point from where
differentcomputers and other devices are connected. It broadcasts all network data across each
connection.
Hub is mostly used in physical star topology.
Switch
A switch is a networking device that has multiple connecting ports which is often used interchangeably
withthe bridge.
Bridge
A bridge is a device that connects two or more similar types of network which filters the data or
inspectsincoming signals and decides whether to forward the signals or discard them.
Gateway
Gateway is an interconnecting device that connects two dissimilar networks
Repeater
5
Edited by: Krishna Sir. Developed by: Deepak Sir.
Repeater is a device that amplifies the incoming signals, creates a copy of it and transmits the
signal onnetwork.
MODEM
MODEM is a device which is used to transfer the data of one computer to another computer using
telephone lines.
The role of MODEM in data transmission is that it transfers data from one computer to another
throughtelephone line. It also converts the digital signal into analog and vice versa.
Importance of MODEM
MODEM modulates the digital codes of the computer into analog signal, which then can travel
through the telephone cable. At the receiving end the MODEM kept there will demodulate the
analog signal to digital codes, which can be then understood and used by the receiving computer. In
this way a MODEMmakes the computer network possible.
Modulation
The process of translating digital signals of a computer to analog signals, which are then transmitted
across the standard telephone lines, is known as modulation.
Demodulation
The process of translating analog signals from a phone line and converts then into digital signals for the
computer is known as demodulation.
Types of Networks
a) LAN (Local Area Network)
b) MAN (Metropolitan Area Network)
c) WAN (Wide Area Network)
Network topology (LAN topology) [SLC 2064] [SLC 2065 S] [SEE 2066 S] [SEE 2067 S] [SLC 2068]
The arrangement or connection pattern of computers or nodes and other devices of the network is called
network topology. The three basic topologies are bus topology, ring topology and star topology
Bus topology
The network topology in which computers and other devices are arranged in linear format which uses a
common backbone or wire to connect all the computers and devices is called bus topology.
Ring topology
The network topology in which computers are connected in the shape of a circle without any end
points iscalled ring topology. Each workstation contains two neighbors for communication or an
7
Edited by: Krishna Sir. Developed by: Deepak Sir.
input and output connections.
Star topology
The network topology in which all computers or other devices are connected through a central device
through a central device called hub or switch is called star topology.
Peer-to-peer network
Peer-to-Peer network is a group of computers, which function both as servers and workstations to
sharedata, information and other resources of the network. It lacks centralized network
administration, wherethe network administrator needs to manage security on each computer. It
provides no reliable security and might put data in higher risks.
Client/server network Vs Peer-to-peer network
Internet
Internet is an interconnection of several thousands of computers of different types belonging to the
various networks all over the world in order to share data and information.
In other words, network of networks is called Internet.
The internet is called „network of networks‟ because all the smaller networks of organizations are
9
Edited by: Krishna Sir. Developed by: Deepak Sir.
linkedtogether into the one giant network called the internet.
Services of internet
a) WWW (World Wide Web)
b) E-mail (Electronic mail)
c) FTP (File Transfer Protocol)
d) IRC (internet Relay Chat)
e) Newsgroup
f) Telnet
g) E-commerce
Advantages of internet
a) Internet has an endless knowledge supply which anyone can access that too free of cost.
b) Selling and buying has become so easy with the use of internet and it has helped millions to
sell andbuy their goods online.
c) Internet has given us E-Mail which is fast, secure and reliable mode of communication.
d) It makes easy to transfer the file or information.
Disadvantages of internet
a) Increasing virus threats not only steals your sensitive data but also damages your computer.
b) People using too much of internet get disconnected from the real world.
c) Pornography that can get in the hands of young children too easily.
d) Addiction to online games affects health leading to obesity and serious health issues.
Intranet
An intranet is a private computer network that uses the internet protocol to securely share any part
of information of an organization. It is owned by a single organization or company. It can only be
used bythe employees of the owned organization.
Extranet
An extranet is a computer network that allows controlled access from outside for specific business or
educational purposes.
Advantages of E-mail
a) It allows to send and receive message across the world at very low cost.
b) E-mail is faster, cheaper, more reliable than traditional mail.
c) The image, sound, video and documents can be attached to e-mail message.
d) Email can be accessed from anywhere in the world.
Disadvantages of e-mail
i) Minor mistakes in e-mail address may deliver the mail to wrong address.
ii) Since it passes through a vast electronic network, it may be seized in between.
Newsgroup
Newsgroups are discussion groups that focus on a particular topic such as politics, health, computer, etc.
Theinterested people on the particular field write the information or articles. Then these articles are posted
to thenewsgroup so that other people can read them.
Telnet
A telnet is a program that allows a user to log in to a remote computer on internet as a user on that system.
Downloading
Downloading refers to the copying files or document or program or data from the internet server to the
user computer.
11
Edited by: Krishna Sir. Developed by: Deepak Sir.
software. It communicates only text. For e.g.: chatting on Facebook.
Video conferencing
Video conferencing is an important and interesting service provided by the internet which makes
communication using sounds as well as pictures. It requires necessary hardware and software to see and
speak to each other. It enables virtual face-to-face communication among people sitting at different
locations. For e.g.: chatting on skype.
Web browser
Web browser is a computer program that access web pages and displays them on the user computer.
Examples of web browsers are Mozilla Firefox, Google chrome, Internet Explorer, opera etc.
Browsing/Surfing means searching information on the internet.
Search engine
Ans: A search engine is a software program or script available through the Internet that searches
documents and files for keywords and returns the results of any files containing those keywords. They
are used to locatespecific sites and information. Examples of search engines are Google, Bing, Yahoo
etc.
Blog (weblog)
A blog is a time-stamped online journal that appears on a website. A blog is a frequently updated online
personal journal or diary. A place to share your thoughts and your passions to the world.
The development of ICT has made possible to store large amount of data in the virtual world and make
communication through it. At the same time, computer crimes and abuse of data, privacy violations,
pornography are increasing.
12
Edited by: Krishna Sir. Developed by: Deepak Sir.
Challenges of ICT
1. Virtual Identity
a) A major problem in the ICT environment.
b) Internet criminals enter into the system by creating fake identities and use the system for
theirbenefits which is difficult to recognize and control.
2. Security
a) Hacking or unauthorized access of system is increasing.
b) Hackers are the greatest challenge for the ICT security personnel.
c) Hackers hack others data and use for their benefits especially in banking and commercial
sectors.
Privacy Issues
a) Cyber bullying is a kind of harassment using mobiles or computers.
b) Kind of harassment using electronic devices such as mobiles and computers.
c) Sharing unnecessary information of individual or group of people is the danger of ICT in this
era.
d) Using internet many users bully others.
3. Copyright
a) A legal right that grants the creator of an original work.
b) Because of its openness and easy access, through the internet, users can easily access the
work ofothers and use them for the benefits without the permission of the creator.
4. Social Behavior
a) Excessive use of internet has changed the behavior of the people.
b) Negative effects on sleep, work and academic achievements of the students.
c) Usage of unethical sites has increased negative behaviors and crimes in society.
d) Employees use internet at their workplace for non-productive works.
5. Digital Divide
a) The Digital Divide is a social issue referring to the differing (conflicting) amount of
information between those who have access to the Internet (especially broadband access) and
those who do not have access.
b) In education sector, developing countries have poor old education systems, so students will
not be aware of new information technologies.
c) In remote areas, they do not even have power, so information technology looks like computer
cannot be used.
d) To get ICT benefits, developing countries should train their human resource and also adopt
new culture which is a bit costly.
Computer Ethics
Computer ethics can be defined as to follow the rules and regulation of computer technology and not to
harm other computer users knowingly or unknowingly.
Cyber Law
❖ Cyber law refers to the laws regarding the internet and cyberspace which includes a wide variety of
legalissues related to the use of communication technology.
13
Edited by: Krishna Sir. Developed by: Deepak Sir.
❖ Cyber Law (also known as Electronic Transaction and Digital Signature Act (ETDSA)) was passed
on30th Bhadra 2061 (15 September 2004).
Digital Signature
A digital signature is an electronic form of a signature that can be used to authenticate the identity of the
sender of a message or the signer of a document, and also ensure that the original content of the message
or document that has been sent is unchanged.
It is necessary to keep the uniformity standard and guarantee in all the activities of the e-sector.
Cyber crime
Cybercrime is a crime committed by using cyber means/computer
technology.Cybercrime is also known as computer-related crime.
Illegal activities committed using computer technology
a) Damage to computer and computer system.
b) Acts to gain illegal access into the system.
c) Use as weapons to commit other crimes.
d) Acts against the provision of cyber law.
Digital citizenship
❖ A digital citizen is anyone who uses digital tools such as computers, cell phones, or the Internet.
Youcan use these tools in your work, at school or for recreation.
❖ Digital citizenship refers to the responsible use of technology by anyone who uses
computers,the Internet, and digital devices to engage with society on any level.
❖ Digital citizenship applies to “those who use the Internet regularly and effectively,”
❖ Good digital citizenship engages young students and shows them how to connect with one
another,empathize (understand) with each other, and create lasting relationships through digital
tools.
❖ Bad digital citizenship, on the other hand, entails (involves) cyber bullying, irresponsible
socialmedia usage, and a general lack of knowledge about how to safely use the Internet.
Examples of Digital Citizenship
a) Communicating with respect
b) Respecting other’s privacy
14
Edited by: Krishna Sir. Developed by: Deepak Sir.
c) Adding helpful information/context to a discussion or wiki page
d) Supporting others by offering useful feedback
e) Encouraging them, or sharing work they’re proud of, etc.
Digital footprint
❖ A trace of data you create while using the Internet.
❖ Includes the websites you visit, emails you send, and information you submit to online services.
❖ Your online identity and individuality and is what makes you unique.
❖ It builds the online reputation, or impression depending on the things you do online.
❖ It is important to be aware of it because anything posted online is permanent and stays
foreverregardless of being deleted.
❖ Publishing a blog and posting social media updates are another popular ways to expand your
digitalfootprint.
❖ Every tweet you post on Twitter, every status update you publish on Face book, and every
photo youshare on Instagram contributes to your digital footprint.
❖ The more you spend time on social networking websites, the larger your digital footprint will be.
❖ Even "liking" a page or a Face book post adds to your digital footprint, since the data is
saved onFace book’s servers.
"Everything leaves a digital footprint. Whatever gets created may never go away. If they don’t want to see
ittomorrow, they'd better not post it today"
IT Policy 2072
❖ IT Policy launch in Nepal – 2000 AD (2057 BS)
❖ Most recent and the latest information technology policy– ICT Policy 2015 (2072 BS)
a) Nepal will strive towards enhancing overall national ICT readiness with the objective of being at
least in the top second quartile of the international ICT development index and e-Government
rankings by 2020.
b) At least 75 percent of the population will have digital literacy skills by the end of 2020.
c) A universal broadband access to all people on an equitable basis will be in place. By 2020, 90
percent of the population will be able to access the broadband services.
d) The role and significance of ICT industries and services (including telecom services) will increase
inthe Nepali economy with ICT value added (including digital content and service industry)
accounting for at least 7.5% percent of GDP by 2020.
e) The jurisdiction of Nepal Telecommunications Authority will be expanded to secure complete
alignment with policy provisions outlined in this document. Along these lines, Nepal
Telecommunications Authority will be renamed Nepal Communication Authority and its areas of
operation restructured accordingly.
f) By 2020, entire population of Nepal would have access to internet
g) 80% of all citizen facing government services would be offered on line by 2020
h) e-Procurement will be promoted as means of driving transparency through government
procurementprocesses covering all public procurement of goods and services irrespective of cost
and volume of such procurements by 2018
i) G2G implementation would be promoted with a view to achieving complete automation of the
operations of land administration, revenue administration and management, vital registration,
passport and citizenship certificate services by 2020.
j) Broadband access will be expanded across the country with the goal of achieving a broadband
Internet user penetration rate of 30% at a minimum of 512kbps and making available at least 10
Mbps download speed on demand in urban areas by 2018.
k) Special funding arrangements will be developed and implemented within 2018 to support
innovation and incubation of on-line businesses and start-ups
16
Edited by: Krishna Sir. Developed by: Deepak Sir.
h) To safeguard public sector information and investment against negative impacts of deploying
and using ICTs.
i) To improve communication systems across the country especially in areas of touristic interest to
support tourism development in the country
j) To conserve natural resources and safeguard Nepal's heritage using ICT tools.
The primary role of Information and Communication Technology Policy Implementation Steering
Committee is to provide overall coordination support for the effective implementation of policy
provisions along with monitoring and evaluation of policy interventions.
The Steering Committee will form an ICT Policy Implementation Sub-Committee comprising of
representation from the stakeholder community and domain experts, including the private sector, to
provideit with domain specific expert advice and recommendations in relation to the execution of policy
provisions.
Electronic Transaction
❖ Transactions of electronic records data by using any types of electronic means.
❖ Contains electric records and valid digital medium.
❖ The exchange of all types of records which are in the form of electronic.
When was electronic transaction act 2063 authenticated and published in Nepal?
⚫ December 8 2006 (22 Mangshir 2063)
Social Media
❖ The 'social' part: refers to interacting with other people by sharing information with them
andreceiving information from them.
❖ The 'media' part: refers to an instrument of communication, like the internet (while TV, radio,
andnewspapers are examples of more traditional forms of media).
❖ Social media is computer-based technology that facilitates the sharing of ideas, thoughts, and
information through the building of virtual networks and communities.
❖ By design, social media is internet-based and gives users quick electronic communication of
content.
❖ Content includes personal information, documents, videos, and photos.
❖ Users engage with social media via computer, tablet or smart phone via web-based software or
webapplication, often utilizing it for messaging.
❖ Social media may take the form of a variety of tech-enabled activities. These activities include
photo sharing, blogging, social gaming, social networks, video sharing, business networks, virtual
worlds, reviews and much more.
❖ Even governments and politicians utilize social media to engage with constituents and voters.
❖ For individuals, social media is used to keep in touch with friends and extended family.
❖ Some people will use various social media applications to network career opportunities, find
people across the globe with like interests, and share their thought, feelings, insight, and emotions.
Those who engage in these activities are part of a virtual social network.
❖ For businesses, social media is an indispensable tool. Companies use the platform to find and
engagewith customers, drive sales through advertising and promotion, gauge (find) consumer
trends, and offering customer service or support.
Security Threats
⚫ A risk which can potentially harm computer systems and organization.
⚫ The cause could be physical such as someone stealing a computer that contains vital data.
⚫ The cause could also be non-physical such as a virus attack.
⚫Perform a variety of different functions such as stealing, encrypting or deleting sensitive data,
altering or hijacking (taking control) core computing functions and monitoring users' computer
activity without their permission.
Types of malwares
a) A virus is the most common type of malware which can execute itself and spread by infecting
otherprograms or files.
b) A worm can self-replicate without a host program and typically spreads without any
humaninteraction or directives from the malware authors.
c) A Trojan horse is designed to appear as a legitimate (valid) program in order to gain access
to asystem. Once activated following installation, Trojans can execute their malicious
functions.
d) Spyware is made to collect information and data on the device user and observe their
activitywithout their knowledge.
e) Keyloggers, also called system monitors, are used to see nearly everything a user does on
theircomputer. This includes emails, opened web-pages, programs and keystrokes.
Security mechanisms
⚫ A mechanism that is designed to detect, prevent, or recover from a security attack.
⚫ It includes
⚫ Authentication Systems
⚫ Firewalls
⚫ Cryptography
⚫ Antivirus Software
⚫ Backup System
Authentication System
⚫ Authentication is the process of verifying the identity of a person or device.
⚫ Authentication system makes sure that right people enter the system and access the
rightinformation.
⚫ Types of Authentications
⚫ Password
⚫ Biometric
Password
⚫ A set of secret characters or words used to authenticate access to a digital system.
⚫ Password ensures that unauthorized users do not access the computer.
⚫ Password secures the data by protecting the data from unauthorized access.
⚫ To protect a system from unauthorized access, password should be kept in a system which provides
security to the system.
⚫ A password should be difficult to guess and determine and should be changed
regularly andmemorized.
Biometric
⚫ Biometrics are physical or behavioral human characteristics that can be used to digitally
identify aperson to grant access to systems, devices or data.
⚫ Examples of these biometric identifiers are fingerprints, facial patterns and voice.
⚫ Computers and devices can unlock automatically when they detect the fingerprints of an
approveduser.
⚫ Apple's Face ID (introduced with the iPhone X) authenticates users by facial recognition.
21
Edited by: Krishna Sir. Developed by: Deepak Sir.
⚫ Retinal scanners, which require an eye scan to allow authorized individuals to access secure areas.
Firewall
⚫ A network security device, either hardware or software that monitors and filters all
incoming andoutgoing network traffic based on an organization’s previously established
security policies.
⚫ Firewall blocks unwanted traffic as well as malicious software from infecting your computer.
⚫ Firewalls helps to prevent unauthorized access.
⚫ Software firewalls are designed to protect a computer by blocking certain programs from
sendingand receiving information from a local network or the Internet.
⚫ Hardware firewalls are found on most network routers and can be configured through the router
setup screen.
Cryptography
⚫ A technique of securing information and communications through use of codes so that only
those people for whom the information is intended can understand it and process it.
⚫ Thus, preventing unauthorized access to information.
⚫ The prefix “crypt” means “hidden” and suffix grapy means “writing”.
⚫ A message sent over the network is transformed into an unrecognizable encrypted message
known asdata encryption. At the receiving end, the received message is converted to its original
form known as decryption.
⚫ Cryptography is used to secure and protect data during communication.
Features of Cryptography
a) Confidentiality: Information can only be accessed by the person for whom it is intended
and noother person except him can access it.
b) Integrity: Information cannot be modified in storage or transition between sender and
intendedreceiver without any addition to information being detected.
Decryption
⚫ Decryption is a process of converting encoded/encrypted data in a form that is
readable andunderstood by a human or a computer.
⚫ This method is performed by un-encrypting the text manually or by using keys used to encrypt the
original data.
22
Edited by: Krishna Sir. Developed by: Deepak Sir.
KEY DIFFERENCE BETWEEN ENCRYPTION AND DECRYPTION
a) Encryption is a process of converting normal data into an unreadable form whereas
Decryption is amethod of converting the unreadable/coded data into its original form.
b) Encryption is done by the person who is sending the data to the destination, but the
decryption isdone at the person who is receiving the data.
c) The same algorithm with the same key is used for both the encryption-decryption processes.
Antivirus software
⚫ Antivirus software is software designed to detect and remove virus from computer
system andensures virus free environment.
⚫ E.g., Kaspersky, NAV, MSAV, McAfee, NOD 32 etc.
⚫ Main use of antivirus is to protect computer from viruses and remove viruses that are
detected andalso protects data and programs from being corrupted.
Backup system
⚫ It is the system of copying data and programs into another location or creating a duplicate copy
of itin a secured place.
⚫ A copy of a file which is used in the event of the original file being corrupted.
⚫ Backup is vital to computer security system in order to save the data from being lost or damaged
dueto accidental or intentional harm. When data and software are lost or damaged, we can easily
recoverthrough backup.
⚫ These files are kept on hard disks, CDs and tapes and on the internet.
Hardware Security
⚫ The security given to the machine and peripheral hardware from theft and from electronic
intrusion(interruption) and damage.
Regular Maintenance
⚫ Computer system need regular maintenance to keep the computer hardware in good
working condition and it also helps to find out problems in hardware and correct the
problems before theycause several damages.
⚫ The hardware components of computer systems are very delicate and gets damaged if proper care
is
not taken.
⚫ E.g., CPU cooler not working properly and if we don’t repair or replace on time then the
computersystem may get halted and can damage microprocessor.
⚫ Another E.g., Computer Hard disk which needs to be checked frequently in order to find errors and
keep in good condition.
23
Edited by: Krishna Sir. Developed by: Deepak Sir.
Insurance
⚫ A means of protection from financial loss.
⚫ If a computer is damaged or stolen or any kind of harm done then we can claim for the
insuranceamount and get the economic support.
Volt Guard
⚫ A power protection device that provides constant output voltage to the computer system in
case ofhigh input voltage coming from the source.
UPS
⚫ UPS is a battery supported power protection device which controls the electric voltage and
suppliesclean and continuous power to the computer system even during power failures.
24
Edited by: Krishna Sir. Developed by: Deepak Sir.
⚫ The importance of UPS in computer security system is that it controls fluctuation of electric
voltage
and provides enough backup electric power to the computer system when there is power failure.
Spike Guard
⚫ A device designed to protect electrical devices from voltage spikes.
⚫ Automatically maintains a constant voltage level.
1.4 E-Commerce
E-Commerce
Advantages of E-commerce
c) You can set up an online business even by sitting at home if you have the required
software, adevice, and the internet.
d) There are no geographical boundaries for e-business. Anyone can order anything from
25
Edited by: Krishna Sir. Developed by: Deepak Sir.
anywhere atany time.
Disadvantages of E-commerce
d) Anyone can start an online business, which sometimes leads to scam and phishing sites.
e) There are many hackers who look for opportunities and thus an ecommerce site, service
paymentgateways all are always prone (liable to suffer from) attack.
⚫ The online transactions through the wireless handheld devices such as mobile phone,
laptop,palmtop, tablet, or any other personal digital assistant.
⚫ It does not require the user to sit at the computer that is plugged in and perform the
commercialtransactions.
⚫ People can perform several functions such as pay bills, buy and sell goods and services,
access emails, book movie tickets, make railway reservations, order books, read and watch
the news, etc.
Advantages of M-Commerce
⚫ Easy To Use - It is the easiest purchase where without any disturbance you can search all the
onlinesites and choose the best among the one.
⚫ More Access To User Data - Once a purchase is been done from a store user’s information
getsstored. Which can be used in the future by sending about the deals and offers to the
users.
⚫ Time-Saving - Instead of physically going to the store’s users can easily select and purchase
anyproduct of any brand and place they want. Saving both the time and energy of the user.
⚫ Global Customer Base - If an individual has a mobile device and internet connection then they
arethe potential customer to any platform. you can choose, select and purchase any product
from anyplace you want.
⚫ Easy Inventory Management - You can manage and maintain your inventory levels regardless of
howsmall it is. Saving all the product database you can easily know what product is available or
not.
Disadvantages of M-commerce
⚫ Smartphone Limitation - No matter how useful it is without the use of smartphone user can
26
Edited by: Krishna Sir. Developed by: Deepak Sir.
neveraccess and navigate the data properly.
⚫ Connectivity - Without accessing the internet connections user will not be able to receive any
data topurchase.
⚫ Need Faithful Shipment Company - You should tie-up with a good shipping company for
deliveringyour products on time to the users.
⚫ Security - Entering all the details of your bank and security codes. Which sometimes can harm
you,also syncing of data or connecting to unknown Wi-Fi networks may appear risky by
hacking or bypassing your information to others.
Online Payment
⚫ Making transactions or paying for goods and services through an electronic medium, without
the useof checks or cash.
⚫ It helps in sending and receiving the money online, buy air tickets, pay utility bills, purchase
mobilerecharge cards, pay school college bills, internet bills, subscribe newspaper and
magazines online, etc.
a) Low labor costs - Since online payments are usually automatic, they have lower labor costs
thanmanual payment methods, such as cheque, money order and cash.
b) Convenience for online sales - Online payment methods allow conveniently selling
goods andservices online.
c) Automatic - Online payments can be automatic, which can be convenient for you and
yourcustomers.
d) Fast transaction speed - Online transactions quickly provide feedback to you and your customers.
e) Low risk of theft - After processing delays, online payments generally go straight into your
bankaccount, so they have a low risk of theft.
a) Service fees - Payment gateways and third-party payment processors charge service fees.
b) Inconvenient for offline sales - Online payment methods are inconvenient for offline sales.
e) Technical problems - Online payment methods can go down due to technical problems.
Artificial intelligence
Artificial intelligence (AI) is an area of computer science that emphasizes the creation of intelligent
machines that work and reacts like humans. John McCarthy coined the term Artificial Intelligence in
theyear 1955.
Applications of AI
a) Gaming − AI plays crucial role in strategic games such as chess, poker, tic-tac-toe, etc.,
wheremachine can think of large number of possible positions.
b) Natural Language Processing − It is possible to interact with the computer that understands
naturallanguage spoken by humans.
c) Expert Systems − There are some applications which integrate machine, software, and special
information to impart reasoning and advising. They provide explanation and advice to the
users. (For example, some expert systems help doctors diagnose diseases based on symptoms)
d) Vision Systems − These systems understand the visual input on the computer. For example,
Policeuse computer software that can recognize the face of criminal with the stored portrait
made by forensic artist.
e) Intelligent Robots − Robots are able to perform the tasks given by a human. They have
sensors to detect physical data from the real world such as light, heat, temperature,
movement, sound, bump,and pressure. They are capable of learning from their mistakes and
they can adapt to the new environment.
Examples of AI
a) Siri / Alexa- both use AI to help your complete tasks or answer questions on your mobile devices.
b) Netflix / YouTube - uses advanced predictive technology to suggest shows based on your
viewingpreferences or rating.
c) Facebook Feed - filter content that is most likely to be of interest to the particular Facebook
user andpredict what they will want to see.
Virtual Reality
An artificial environment created with computer hardware and software and presented to the user in
such away that it appears and feels like a real environment.
To "enter" a virtual reality, a user wears special gloves, earphones, and goggles, all of which
receivetheir input from the computer system.
In this way, at least three of the five senses are controlled by the computer.
In addition to feeding sensory input to the user, the devices also monitor the user's actions.
The goggles, for example, track how the eyes move and respond accordingly by sending new video input.
Application areas of VR
a) It can be used in medical studies to enable students to know the human body structure.
b) It can be used in scientific research laboratories so that scientist can easily research on a
specifictopic.
c) It can be used in entertainment like in games and movies to make the gaming experience more
29
Edited by: Krishna Sir. Developed by: Deepak Sir.
realand to allow individual to experience adventures under extreme conditions.
d) It can be used in driving schools as it gives a real look of roads and traffic.
e) It can be used in military training for the soldiers to get familiar with different areas in the
battlefield.
E-Governance
a) The use of ICT and its application by the government for the provision of information and
publicservices to the people.
b) The basic purpose of e-governance is to simplify processes for all, i.e., government, citizens,
businesses, etc. at National, State and local levels.
c) It is the use of electronic means, to promote good governance.
d) An ordinary citizen gets the government facility through the internet.
Models of E-Governance
a) Government-to-Citizen(G2C)
b) Government-to-business (G2B)
c) Government-to-Government (G2G)
d) Government-to-Employee (G2E)
Government-to-Citizen(G2C)
a) G2C-is transaction between the government to citizens.
b) It helps the ordinary people to reduce the time and cost to conduct a transaction.
c) A citizen can have access to the services anytime from anywhere.
d) It includes online registration of birth/ death/marriage certificates, filling of income taxes,
electricitybills, license renewals etc.
Government-to-business (G2B)
a) G2B it is the transaction between government to business.
b) It is efficient for both government and business organizations.
c) It enhances the efficiency and quality of communication and transparency of government projects.
d) It includes online application forms, renewing licenses, registration etc.
Government-to-Government (G2G)
a) G2G it is the transaction between government to government.
b) Government agencies can share the same database using online communication.
c) It can communicate with global government and local government as well.
d) It provides safe and secure inter-relationship between domestic or foreign government.
Government-to-Employee (G2E)
30
Edited by: Krishna Sir. Developed by: Deepak Sir.
a) G2E it is the transaction between government to employee.
b) G2E aims to bring employees together and improvise knowledge sharing.
c) G2E provides online facilities to the employees like applying for leave, reviewing salary
paymentrecord and checking the balance of holiday.
d) G2E is also the relationship between employees, government institutions, and their management.
Advantages of E-Governance
a) Speed - Electronic technologies make communication better, and faster. It will take very less
time for any policy, or scheme to reach to the people.
b) Transparency - The use of e-governance helps make all functions of the business transparent.
All the information of each and every policy will be directly available to the citizens.
c) Accountability - Accountability is answerability to the people by the government. Once the
transparency is achieved the government will automatically become accountable.
d) Reduction In Cost - A lot the Government expenditure goes towards the cost of buying stationery
forofficial purposes. However, replacing them with smart phones and the internet can saves crores
of money in expenses every year.
Disadvantages of E-Governance
a) Loss of Interpersonal Communication - Interpersonal communication is an aspect of
communicationthat many people consider vital.
b) High Setup Cost and Technical Difficulties - the setup cost is very high and the machines have to
be regularly maintained. Often, computers and internet can also break down and halts
governmental work and services.
c) Illiteracy - People who doesn’t know how to operate computers and smart phones will be very
difficult for them to access and understand.
d) Cybercrime/Leakage of Personal Information - There is always the risk of private data of citizens
stored in government serves being stolen. Cybercrime is a serious issue; a breach of data can
make the public lose confidence in the Government’s ability.
Mobile Computing
⚫ A technology that allows transmission of data, voice and video via a computer or any other
wirelessenabled device without having to be connected to a fixed physical link.
⚫ A variety of devices that allow people to access data and information from wherever they are.
31
Edited by: Krishna Sir. Developed by: Deepak Sir.
c) Personalization: You can modify your mobile computing to your individual needs.
Features of Mobile Computing
a) Easy to handle and carry these small devices.
b) Ability to share data and collaboration between users.
c) Data can be transferred easily between users.
d) People can work from the comfort of any location they wish to as long as the connection and the
security concerns are properly factored.
e) The presence of high-speed connections has also promoted the use of mobile computing.
The Internet of Things (IoT)
⚫ A technology that connects all electronic devices together and prompts them to exchange
information without any human intervention.
⚫ A system of interrelated computing devices, mechanical and digital machines, objects, animals
or people that are provided with unique identifiers (UIDs) and the ability to transfer data over a
network without requiring human-to-human or human-to-computer interaction.
⚫ The term "The Internet of Things" was coined by Kevin Ashton in a presentation to Proctor &
Gamble in 1999.
Components of IoT
a) Sensors/Devices - Sensors/Devices collect data from their environment. e.g., Our phone is a
device that has multiple sensors like GPS, camera, Motion etc. where data is being collected
based on surroundings
b) Connectivity to Cloud - The sensors/devices can be connected to the cloud and store, through a
variety of methods including: Bluetooth, Wi-Fi, Cellular etc.
c) Data Processing - Software perform data processing on cloud data to get an analyzed or computed
data. e.g., Computing the temperature within an acceptable range.
d) User Interface - The analyzed or computed data is made useful to the end user via and alert (email,
text, notification). e.g., an alert message when temperature is beyond the acceptable range.
Applications of Internet of Things (IoT)
a) Smart home - Smart home encapsulates the connectivity inside your homes. It includes smoke
detectors, home appliances, light bulbs, windows, door locks, etc.
b) Smart City - Smart city offers all types of use cases which include traffic management to
waterdistribution, waste management, etc.
c) Parking Sensors - IOT technology helps users to identify the real-time availability of
parkingspaces on their phone.
d) Connected Cars - IOT helps automobile companies handle billing, parking, insurance, and
otherrelated stuff automatically.
e) Activity Trackers - Helps you to capture heart rate pattern, calorie expenditure, activity
levels,and skin temperature on your wrist.
Advantage of IOT
a) Accessing information is easy; you can control a device that is miles apart in real time.
b) Communication between the connected devices becomes more transparent and easier.
c) Transferring data packets over a network reduces both time and money.
32
Edited by: Krishna Sir. Developed by: Deepak Sir.
d) Automation is the need of the hour; IOT reduces human intervention and efficiency of services
Disadvantage of IOT
a) There is a huge risk of leakage of confidential data, when sent over a network.
b) Due to its complex network, a single loophole can put the entire system down, affecting
everyone.
c) With automation, the need of human labor reduces drastically.
d) Today’s lifestyle is technology driven; we depend on the technology for the tiniest of tasks.
E-learning
E-learning is a new concept of delivering digital contents in learner-oriented environment using
informationand communication technology (ICT). Delivery of the digital content is the main characteristic
of e-learning.
Advantages of e-learning:
a) It is easy for customization.
b) There is no any geographical limitation for learning.
c) It is quite favorable for learner as it can happen at any time and anywhere.
d) It reduces or eliminates travel costs to attend learning events.
e) It reduces or eliminates need for classroom/instructor infrastructure.
Disadvantages of e-learning:
a) Learners with low motivation or bad study habits may fall behind
b) Students may feel isolated from the instructor and classmates
c) Instructor may not always be available when students are studying or need help
d) Slow Internet connections or older computers may make accessing course materials frustrating
e) Managing computer files and online learning software can sometimes seem complex for
studentswith beginner-level computer skills
E-Banking
⚫ to conduct financial transactions via the Internet.
⚫ funds transfer, payment of bills, opening bank accounts online, and much more.
⚫ consumers aren't required to visit a bank branch in order to complete most of their basic
bankingtransactions.
⚫ A customer needs a device, an Internet connection, and a bank card to register. Once
registered, theconsumer sets up a password to begin using the service.
Features of E-Banking
a) Faster Transactions - People don’t need to wait in queue to transfer their funds or pay off their
bills;they can easily do it through their device. It saves the time of customers as they can easily
access their account with the help of their device.
b) Lowers Transaction Cost - Whole transactions are done online over the internet. It has reduced
the manpower requirements as workload is reduced. It has also reduced the paperwork in
organizations as all transactions are recorded digitally.
c) Provides 24×7 Service - Customers can easily access their account anytime & from anywhere
33
Edited by: Krishna Sir. Developed by: Deepak Sir.
with no limitations. It provides convenience to the customers as they can perform transactions as
per theirwish.
d) Reduces The Chances of Error - E-banking system works fully automated over the internet. All
transactions are recorded & stored digitally. There is no need to manually maintain each & every
record in books of account. So, the chances of human error are minimized.
e) Develops Loyalty in Customers - Customers are able to get a user-friendly interface from the
banking website. They are able to avail services any time even from their home comfort. This
develops a sense of loyalty among customers when they are happy with the services of their banks.
Internet Banking
⚫ a facility offered by banks and financial institutions that allow customers to use banking
servicesover the internet.
⚫ Customers need not visit their bank’s branch office to avail each and every small service.
⚫ Use PC or laptop and internet connection to use this facility.
⚫ Kumari Bank was the initiator of internet banking in Nepal. It started its e-banking services in
2002.
35
Edited by: Krishna Sir. Developed by: Deepak Sir.
Database
A database is an organized collection of related information that can be used for different purpose so
thatit can easily be accessed, managed, and updated.
E.g., Dictionary, Marks Ledger, Telephone Directory etc.
Computerized Database
a) It can store large volume of data. It is very fast to find a specific record.
b) Data can be sorted into ascending or descending order on multiple criteria.
c) The database can be kept secure by use of passwords.
d) We can search data very easily.
e) Modification is very easy in comparison of manual database.
Non-Computerized Database
a) It is limited by physical storage available.
b) It can take a while to manually search through all of the records.
c) Difficult to sort data on more than one criterion.
d) The only security would be locking up the records.
MS-Access
MS-Access is a relational database management system developed by Microsoft Corporation which
isused to store and manipulates large volume of data in the form of table.
Features of MS-Access
a) It provides the flexible ways to add, edit, delete and display the related data.
b) Queries help to view, change and analyze the data indifferent ways.
c) Forms are used for viewing and editing the information.
d) Reports are used for summarizing and printing the data.
Objects of MS-Access
a) Table
36
Edited by: Krishna Sir. Developed by: Deepak Sir.
b) Form
c) Query
d) Report
Table
Table is an object of MS-Access that stores large volume of data in the form of rows and
columns.The different ways to create table are:
i) Design view
ii) Using wizard
iii) Entering data
Importance of table
a) Different properties of a field can be set in a table.
b) It provides options for primary key which helps to make data consistent.
Record
Record is complete set of information. Record is a collection of multiple related fields in a row
whichgives complete information about a person or thing. E.g.: Ram Chabahil 4468790
Field
Field is a small unit of information. A column in a table is called field, and it contains a specific
piece ofinformation within a record. E.g.: Name, Address, Telephone
Primary key
A key that uniquely identifies each record in a database is primary key. It is needed because it neither
accepts duplicate values now null values.
Composite key
The group of primary keys that consists of two or more attributes is called composite key.
Foreign Key
Foreign key is a unique field or combination of fields in linked table whose value matches
with aprimary key in another table.
37
Edited by: Krishna Sir. Developed by: Deepak Sir.
Data Redundancy
Data redundancy means repetition of same piece of data in a database in more than one location.
Dataredundancy can be controlled in MS-Access by normalization of database.
Data type
Data type is an attribute for a field that determines what type of data it can
contain.Any four data types of MS-Access are:
i) Text
ii) Number
iii) Memo
iv) Currency
While designing table structure which data types are suitable to store information about teacher’s
name, address, salary and date of birth.
Teacher’s name
- TextAddress –
Text
Salary – Currency
Date of birth – Date/Time
Identify a record, field and value from the following table structure. [SQE 2074]
Roll Name Marks
1 Kopila 87
2 Rabin Rana 56
Text
It is used for storing text or combination of text and numbers. It can store up to 255 characters.
Memo
It is used for storing lengthy text and numbers. It can store up to 65,535 characters.
Field properties
The four types of field properties of MS-Access are:
i) Caption ii) Format iii) Validation rule iv) Input mask
Input mask
Input mask is a field property that controls the value of a record and sets in a specific format.
Caption
Caption is a field property which displays an alternate name for the field to make the field name more
explanatory. It can contain up to 2048 characters.
Validation rule:
38
Edited by: Krishna Sir. Developed by: Deepak Sir.
A field property which enables to limit values that can be accepted into a field is known as
validationrule.
Validation text
A field property which allows type text to be displayed if the user input value is prohibited by the
validation rule is known as validation text.
Field size
Field size is a field property that specifies the maximum number of characters allowed in the field.
Format
The use of „Format‟ field property is to display data in a different format.
Lookup Wizard
The use of Lookup Wizard is that it creates a field that allows choosing a value from another table
orfrom a list of values by using a list box or combo box.
Hyperlink
The use of Hyperlink is that it stores hyper like addresses like email addresses, websites, database objects
Indexing
Indexing is one of the important properties of database that speed up searching and storing of
recordsusing on the field.
Relationship
Relationship is an association among several entities (table). Its types are:
i) One to one relationship
ii) One to many
iii) Many to many relationship
Sorting
Sorting is the process of arranging the record in ascending or descending order according to a given field
orfields. Sorted data is easier to handle than unsorted data.
Advantages of sorting:
i) It helps to find specific information quickly.
ii) It helps to arrange data in alphabetical order.
Filtering
Filtering is an option that selects the required records and displays the result.
Query
Query is an object of MS-Access which extracts and arranges information from a table in a
manner thatis specified.
The different types of queries are:
i) Select query
ii) Action query
In action query, we have update query, append query, delete query and make-table query.
Select query
39
Edited by: Krishna Sir. Developed by: Deepak Sir.
❖ A select query is the most common category and is used for extracting specific information
from oneor more tables in a database. It cannot make changes in tales.
❖ We use select query to group records and perform calculations on field values in the groups
such assum, count, average, minimum and maximum.
Action query
Action query is a query which makes changes to many records in just one operation.
Update query
Update query is a type of action query which make global changes to a group of records in one or
moretables.
Append query
The use of append query is to add a group of records at the end from one or more tables.
Delete Query
A delete query is an action query that deletes a set of records according to criteria that is specified.
Insert Query
❖ Insert queries can be used to insert records from one table into another table, or from a query
into atable.
❖ The records inserted will be appended into that table (rather than replace the previous records).
Advantages of query
a) We can filer, perform calculations and summarize data.
b) Large volume of records can be updated or deleted at a same time.
c) It retrieves and display records including some fields or all the fields of a table or multiple
linkedtables.
Form
❖ Form is an object of MS-Access which provides graphical interface to enter data into the
tables ormultiple linked tables.
❖ Forms are usually displayed on the screen.
❖ Forms generally provide a detailed took at records and usually for the people who actually work
withthe database.
Methods to create a form are:
i) By using auto forms features.
ii) By using the form wizard features.
iii) By using your own in design view.
Importance of Form.
a) It provides an interactive platform for input of data into the database.
b) It helps to display data in more presentable form than a datasheet.
c) It gives a separate platform to handle data.
Report
❖ Report is an object of MS-Access which displays the output in an effective way to present the
data ina printed format.
40
Edited by: Krishna Sir. Developed by: Deepak Sir.
❖ Reports can be previewed on the screen, but they are usually printed.
❖ Reports are often used to group and summarize data, and are often for the people who don’t
workwith the database but who use its information for other business task.
❖ The data sources for report are table and
query.The methods of creating report are:
i) Using design view
ii) Using report wizard
Importance of report
a) It helps to prepare well formatted output.
b) It displays the information the way we want to view it.
c) It presents the information retrieved through queries or tables.
It presents the information in designed layouts by adding necessary titles, setting font color or fontsize, etc.
5. Sub module
Module is a block of statement that solves a particular problem. Sub module is a program which is
written under the main module. A program may have one or more sub modules under main module.
6. Procedure
Procedure is a block of statements that solves a particular program.
Procedure is a section of code which performs one or more specific tasks and can be accessed from
remote location.
There are two types of procedure – SUB Procedure and FUNCTION procedure
7. SUB procedure
A SUB procedure is a small, logical and manageable functional part of program which performs
specific task and does not return any value. SUB-procedure is called by CALL statement. SUB-
41
Edited by: Krishna Sir. Developed by: Deepak Sir.
procedure’s namedoes not accept data type symbol because it does not need to return a value.
8. FUNCTION procedure
A FUNCTION procedure is a small, logical and manageable functional part of a program which
performs specific task and returns single value to the main program or calling module.
FUNCTION- procedure is called by statement and expression method. FUNCTION-procedure’s
name accepts datatype symbols such as $, %, #, &, etc. and it depends on the type of value to be
returned. E.g.: FUNCTION REV$ returns string.
9. String function
String function is used with string it returns string value.
13. Parameters
Parameters are variables that will receive data (arguments value) sent to the procedures (SUB
programand FUNCTION). Formal parameters are called parameter.
14. Arguments
Arguments are the values that are sent to the procedures (SUB program and FUNCTION). Actual or
realparameters are called arguments.
18. SHARED
It is used in the sub program to share the values of certain variables between main module and sub
program
43
Edited by: Krishna Sir. Developed by: Deepak Sir.
3.2 Handling of Data Files
1. Data File
The file which contains data given by the user to the program and information provided by the
user to the computer is called data file. The different types of data file are:
a) Sequential Access files - A data file that stores a sequential data file containing name, address
of some people in the same order or in sequential order is called sequential access data file. It
takes long time to access if the data file contains a large volume of data. In sequential access
data file, we cannot change the existing entry or insert a new entry
b) Random access files
2. Program File
The file which contains a set of instructions that are needed for data processing is called program file.
5. File number
The number assigned to a file in order to identify it during processing is called file number.
44
Edited by: Krishna Sir. Developed by: Deepak Sir.
15. KILL statement: The KILL statement deletes the file or files from the specified drive and
directory.
16. MKDIR statement: It creates a subdirectory which is used to manage files.
17. CHDIR statement: It allows QBASIC to change from one directory to another.
18. RMDIR statement: It is used to remove or delete only the subdirectoriesfrom a disk. It can
remove only empty subdirectories.
19. FILES statement: The FILES statement displays the files of the current sub directory or specified
subdirectory.
20. SHELL: The SHELL statement allows a program to run external programs or command line
statementsin Windows, MAC OS and Linux.
21. INT: It rounds and returns the largest integer less than or equal to a numericexpression.
22. PRINT: Display result on screen.
23. MID$ (): It is a string function that returns the specified number of characters from thespecified
location of string.
24. LEN (): Returns the number of characters in a string or the number of bytes required tostore a
variable.
4.1 C Language
Introduction of C
Structured programming
The programming that follows a top- down approach, on which developers separate the overall
programstructure into different sub selection, is called structured programming.
C language
❖ C language is a structured programming language that divides program into many functions.
❖ Dennis Ritchie at Bell telephone laboratory developed C-language in 1972 AD.
❖ C is called middle level language because it combines elements of high-level language with
somefeatures of assembler.
❖ A high-level language tries to give programmer everything through built-in language.
❖ A low-level language forces programmer to define function directly from user level.
❖ C is mostly used to write system program such as operating system, language, compiler, text
editor,language interpreters, utilities, etc.
❖ C keywords are words which have special meaning for the compiler. Examples are: auto, break,
case,char etc.
45
Edited by: Krishna Sir. Developed by: Deepak Sir.
Data types used in C
Data type are means to identify the type data and associated operation of handling it.
Data Modifiers
Data modifiers change the meaning of the basic data type to fit the various situations. The data
modifiersare: short int, unsigned int and long int
Characteristics of C language
a) It is a high-level language with some features of low-level language.
b) It is mostly used to prepare system software.
c) It is structured programming language with function procedure.
d) It has enough number of inbuilt functions and operators.
e) It is a small programming language which occupies less memory space.
Features of C- language
a) Simple and easy to use
b) Occupies less memory
c) C is the structured programming language.
d) C has powerful set of operators.
e) C is a high-level programming language.
f) C contains very smaller number of keywords
Advantages of C language
a) It is machine independent programming language
b) It is easy to learn and implemented C language
c) It can be implemented from mobile device to mainframe computers.
d) It is the mother of all modern programming language like python, pearl 5 and PHP
Disadvantages of C language
a) There is no runtime checking. It has poor errors detection system.
b) On large programs, it is hard to find errors.
c) There is no strict type checking int data type to float variables.
d) It does not support modern programming methodologies-oriented programming language.
Counter
Counter is a variable which controls the loop statement and provides the track to run the loop
statementin certain number times.
Accumulator
Accumulator is a numeric variable which accumulates the values in a loop statement.
Variable
A variable is a location in the memory of a computer whose value may change during the execution of
program.
46
Edited by: Krishna Sir. Developed by: Deepak Sir.
Constant
Constant are the values that do not change during the execution of a program.
Operator
Operators are special symbols that are meant for specific tasks or operators.
❖ The different types of C operators are: - Arithmetic operators, Assignment operators,
Unaryoperators, Relational operators, Logical operators and Conditional operators.
❖ Arithmetic operators are the operators that are used for manipulating arithmetic data and
performsarithmetic operation. The arithmetic operators are: - +, -, *, / and %
❖ The operator that operates on one operand variable or constant is called urinary operator. E.g., ++,
--
Logical Operator
The operators used for logical operation is called logical operator.
Selection statement.
Selection statement is a statement that allows the selective execution of statements depending on
thevalue of an an expression. The selection statements of C program are: - If statement and
Switch statement
Loop
A set of statements which is used to repeat a block of statements for a specific number of times or
aslong as the condition is true/false is called loop.
The looping statements provided by care: -For loop, while loop and do. .... while loop
❖ Input refers to accepting of data while output refers to the presentation of data.
❖ Input is accepted form keyboard and output is displayed to screen.
❖ Formatted input output functions accept or present the data in a particular format.
❖ printf() and scanf() allow user to format input output in desired format. printf() and scanf()
can beused to read any type of data (integer, real number, character etc.).
47
Edited by: Krishna Sir. Developed by: Deepak Sir.
Format String Meaning
%d Scan or print an integer as signed decimal number
Header File
❖ A header file is a file containing C declarations and macro definitions to be shared between
severalsource files.
❖ You request the use of a header file in your program by including it, with the C
preprocessingdirective „#include‟.
❖ The standard input-output header file, named stdio.h contains the definition of the
functions printf() and scanf(), which are used to display output on screen and to take input from
userrespectively.
❖ The conio.h header file used in C programming language contains functions for console
input/output.Some of its most commonly used functions are clrscr, getch, getche, kbhit etc.
They can be used to clear screen, change color of text and background, move text, check
whether a key is pressed or not and to perform other tasks.
❖ The main () function is like other functions. It also takes arguments, and returns some value. One
point we have to keep in mind that the program starts executing from this main () function. So,
the operating system calls this function. When some value is returned from main (), it is returned
to operating system.
❖ The void main () indicates that the main () function will not return any value, but the int
main ()indicates that the main () can return integer type data.
❖ When our program is simple, and it is not going to terminate before reaching the last line of the
code,or the code is error free, then we can use the void main ().
❖ But if we want to terminate the program using exit () method, then we have to return some
integervalues (zero or non-zero).
❖ In that situation, the void main () will not work. So it is good practice to use int main () over
the voidmain().
If the condition is "true" statement block will be executed, if condition is "false" then statement block
willnot be executed.
48
Edited by: Krishna Sir. Developed by: Deepak Sir.
In this section we are discuss about if-then (if), if-then-else (if else), and switch statement. In C
languagethere are three types of decision-making statement.
• if
• if-else
• switch
if statement
if (expression)
statement;
or
if (expression)
{
Block of Statements
}
or
if (expression)
{
Block of statements;
}
else
{
Block of statements;
}
or
if (expression)
{
Block of statements;
}
else if(expression)
{
Block of statements;
}
else
{
Block of statements;
}
49
Edited by: Krishna Sir. Developed by: Deepak Sir.
switch statement:
The switch statement is much like a nested if .. else statement. Its mostly a matter of preference which you
use, switch statement can be slightly more efficient and easier to read.
Show Example
switch( expression )
{
case constant-expression1: statements1;
[case constant-expression2: statements2;]
[case constant-expression3: statements3;]
[default : statements4;]
}
Looping Statement in C
Looping statement are the statements execute one or more statement repeatedly several number of
times.In C programming language there are three types of loops; while, for and do-while.
When you need to execute a block of code several number of times then you need to use looping
conceptin C language.
Types of Loops.
• while loop
• for loop
• do..while
Note: If while loop condition never false then loop become infinite loop.
for loop
for loop is used to execute a set of statements repeatedly until a particular condition is satisfied. We can
sayit is an open-ended loop. General format is,
do
{
.....
.....
}
while(condition)
51
Edited by: Krishna Sir. Developed by: Deepak Sir.
Computer
Science SEE
Model Question
Time: 1 hr. 30 min F.M: 50
Group “A” (10 Marks)
1. Answer the following questions in one sentence. [6×1=6]
a. What is internet?
Internet is an interconnection of several thousands of computers of different types belonging to the
various networks all over the world in order to share data and information.
b. What is browser?
Web browser is a computer program that access web pages and displays them on the user
computer.
52
Edited by: Krishna Sir. Developed by: Deepak Sir.
b. What is cyber ethics? Write any two cyber ethics.
Cyber ethics can be defined as to follow the rules and regulation of computer technology and not
toharm other computer users knowingly or unknowingly.
Any two cyber ethics are:
53
Edited by: Krishna Sir. Developed by: Deepak Sir.
i. Define form? Write any two uses of it.
Form is an object of MS-Access which provides graphical interface to enter data into the tables or
multiple linked tables.
Any two uses of form are:
i. It provides an interactive platform for input of data into the database.
ii. It helps to display data in more presentable form than a datasheet.
5. Write the output of the given program: (Workout with dry run) [2]
DECLARE SUB OUTPUT1(A)
CLS N=135
CALL OUTPUT1(N)
END
SUB OUTPUT1(A)
DO WHILE A < > 0
R = A MOD 10
T=T+R
A = A \ 10
LOOP
PRINT T
END SUB
Dry run
Var. Var. Condition check Var. Var. Output
N A A<>0 R T
135 135 135 < > 0 Yes 5 5
Loop Continues
13 13 < > 0 Yes 3 8
Loop Continues
1 1 < > 0 Yes 1 9
Loop Continues
0 0 < > 0 No 9
Loop Exits
Output
9
54
Edited by: Krishna Sir. Developed by: Deepak Sir.
Debugged Program
REM to create a new file
CLS
OPEN “ABC.DAT” FOR OUTPUT AS #1
DO
INPUT “Enter Name, Roll No & Total. “; N$, R, T
WRITE #1, N$, R, T
INPUT “Supply more records Y/N”; C$
LOOP WHILE UCASE$(C$) = “Y”
CLOSE #1
END
7. Study the following program and answer the given questions. [2×1=2]
OPEN “EMP.DAT” FOR INPUT AS #1
DO
INPUT #1, N$, A$, S
IF UCASE$ (A$) = “KATHMANDU” THEN
PRINT N$, A$, S
END IF
LOOP WHILE NOT EOF (1)
CLOSE #1
END
a. Write the use of statement “INPUT #1, N$, A$, S” in the above program.
The use of statement “INPUT #1, N$, A$, S” in the above program to read data from the data
fileEMP.DAT.
b. What happens if you remove “UCASE$” from the above program?
If UCASE$ is removed then if Kathmandu is in small letters, then it won’t be displayed on the
screen.
8. Convert / Calculate as per the instruction. [4×1=4]
a. (ABC)16 = (?)8
b. (52)10 = (?)2
c. (1010)2 + (110)2 – (1111)2 = (?)2
d. (1101101)2 (110)2
9. a. Write a program in QBASIC that allows the user to input length, breadth and
height andthen calculate the area of 4 walls. Hint: [A = 2H(L+B)]
DECLARE FUNCTION AREA (L, B, H)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
PRINT “AREA OF FOUR WALLS”; AREA (L, B, H)
END
FUNCTION AREA (L, B, H)
A = 2 * H * (L + B)
AREA = A
END FUNCTION
55
Edited by: Krishna Sir. Developed by: Deepak Sir.
b. Write a program to create a sequential data file named “Employ.Dat” to store Name, Post,
Addressand Salary for the number of employees. The program should terminate on user’s choice.
OPEN “Employ.Dat” FOR OUTPUT AS #1
TOP:
CLS
INPUT “Enter Name”; N$
INPUT “Enter Address”; A$
INPUT “Enter Post”; P$
INPUT “Enter Salary”; S
WRITE #1, N$, A$, P$, S
INPUT “Do you want to continue”; CH$
IF UCASE$ (CH$) = “Y” THEN GOTO TOP
CLOSE #1
END
10. Write a program in C language to input a number and then check whether the number is
positive,negative or zero number.
#include <stdio.h>
#include <conio.h>
int main ()
{
int n;
printf ("Enter any number: ");
scanf ("%d", &n);
if(n>0)
{
Printf ("%d is positive number",n);
}
else if(n<0)
{
Printf (“%d is negative number”,n);
Else
{
Printf (“%d is equal to zero”);
Return 0;
OR
Write a program in C language to display the series 1, 1, 2, 3, 5, 8 up to 10th terms.
56
Edited by: Krishna Sir. Developed by: Deepak Sir.
#include <stdio.h>
#include <conio.h>
int main ()
{
int a, b, c, i;
a=1;
b=1;
for (i=1; i<=10; i++)
{
Printf ("%d \n", a);
c=a + b;
a = b;
b = c;
}
return 0;
}
***
57
Edited by: Krishna Sir. Developed by: Deepak Sir.