Saturday, May 27, 2023

Networking and Telecommunications - SEE COMPUTER SCIENCE 2080

 



Networking and Telecommunications 

SEE COMPUTER SCIENCE 2080

Communication
Communication is sending and receiving information between two or more persons.

 

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. Eg. E-Mail, Chat and phone calls.

 

Components of Data Communication.
i) Data             ii) Sender        iii) Medium     iv) Receiver    v) Protocol

 

Protocol
Protocol is a set of rules by which computers on the network communicate with each other.

E.g. TCP/IP, SMTP, HTTP etc.

 

Data Transmission Mode

Data transmission mode is the way of transmission of data from one location to another. There are three types of transmission mode:
i) Simplex mode        

ii) Half duplex mode 

iii) Full Duplex Mode

 

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.

 

Half duplex mode
The transmission mode in which transmission of data can take place in both directions but only in one direction at a time is called half duplex mode. E.g.: Wireless handset and walkie-talkie.

 

Full duplex mode
The transmission mode in which data can be transmitted in both directions simultaneously is called full duplex mode. E.g.: Telephone, Internet etc.

 

Bandwidth
Bandwidth can be defined as the maximum volume of data that can be transmitted through a communication system.

We can measure bandwidth in digital devices by bits per second and in analog devices by cycles per second or Hertz (Hz).

 

Transmission medium / Communication Channel
Transmission medium is a pathway that can transmit information from a sender to a receiver through wired or wireless medium on a network.

The types of communication medium are: 

 i) Guided Medium (Bounded or Wired)  

ii) Unguided Medium (Unbounded or Wireless)

 

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, fibre optics cable, etc.

 

Features of guided media

a)     Data transmits through the physical cable or fixed path

b)     Data transmission rate is higher.

 

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.

 

Guided VS Unguided Media

Guided Medai

Unguided Media

Guided media is a medium that sends signals through a solid physical path.

Unguided media is a medium that transmits signals through free space.

There is a specific direction to send signals.

There is no particular direction to send signals.

Used in wired transmission

Helps wireless transmission

Twisted pair, coaxial cable, and fiber optics

Radio wave, microwave, and infrared

 

Twisted pair cable

A pair of wires twisted with each other is known as twisted pair cable. A set of four pairs of twisted wires are bundled to form cable. These are the most common medium for LAN. Wires are twisted with each other so as to reduce crosstalk (A disturbance caused by electromagnetic interference, along a circuit or a cable pair). Its types are: a) Unshielded Twisted Pair Cable    b) Twisted Pair Cable

 

Unshielded twisted pair (UTP)

Unshielded twisted pair is a popular type of cable that consists of two unshielded wires twisted around each other which are used in telephone wiring and local area networks (LANs). It is called unshielded because it has no additional foil wrap, or shield.

RJ-45 connector is commonly used with unshielded twisted pair.

 

Shielded twisted pair (STP)

Shielded twisted pair is a type of copper telephone wiring in which each of the two copper wires are twisted together and coated with an insulating coating. The extra covering in shielded twisted pair wiring protects the transmission line from electromagnetic interference

D-shell connectors are used with shielded twisted pair.

Co-axial cable

Coaxial (or “coax”) cable is a common type of cable used for transmitting data over long distances. They are 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    Mbps is the maximum speed of co-axial cable.

 

Fiber optic cable

Fiber optics cable is one of the costlier cables used in data communication which uses light to carry a data signal through the cable.

The connectors used in fiber optics are Screw Mounted Adaptors (SMA), Spring-loaded Twist (ST), SC and FC.

It is costlier to maintain, produce and install.

Radio wave transmission

The transmission making use of radio waves through air is called radio wave transmission.

It provides low bandwidth for data communication.

Radio, TV, cellular phones etc. uses radio transmission in one form or another.

The radio waves can travel through walls and through an entire building.

Depending upon the frequency, they can travel long distance or short distance.

It does not require line of sight for data transmission

 

Microwave transmission

Microwave is a line-of-sight wireless communication technology that uses high frequency beams of radio waves 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 short ranges. 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.

 

Advantages of computer network

a)     Computer in a network can access the network-connected hardware devices like printers, disk drives, etc.

b)     Data in a network environment can be updated from any computer. Updated data can be accessed by all computers on the network.

c)     Computers in a network system share different software packages.

d)     Information can be exchanged rapidly in computer network.

Disadvantages of computer network

a)     The sharing of information may leak the privacy of other clients.

b)     The networking cost is high

c)     If hardware or software malfunctions, it affects the whole network.

d)     Data and information may be stolen by computer hackers if the security of network is not reliable.

Reasons of keeping computers on the network

a)     To share hardware devices like printers, scanners, hard disks etc.

b)     To share data and information.

c)     To share software resources.

d)     To communicate with each other.

 

Hardware components of a computer network (Elements of Network)

Physical parts and devices used to connect computers in the network environment are called hardware components. The hardware components of computer network are

a)     Computer system (Server or Workstation)    b) Network connectors           c) Network cables

d)    NIC Card                   e) MODEM                 f) Hub                                      g) Bridge

 h)     Switch                       i) Router                      j) Gateway                              k) Repeater

 

 

Server

A server is the main computer that provides services, data and other resources to the other computers in the network environment. Network operating software used by server is Novell Netware, Linux, 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.

 

Network Interface Card (NIC)
A Network Interface Card (NIC) is the adapter through which the computer is connected to the network. The function of NIC is to convert data into electronic signals and transfer them through cables and vice-versa. The advantage is to present the platform for a communication between the computers within a network.

 

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 UTP cable, 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 different computers 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 with the bridge.

 

Bridge

A bridge is a device that connects two or more similar types of network which filters the data or inspects incoming signals and decides whether to forward the signals or discard them.

 

Gateway
Gateway is an interconnecting device that connects two dissimilar networks

 

Repeater
Repeater is a device that amplifies the incoming signals, creates a copy of it and transmits the signal on network.

 

 

 

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 through telephone 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 MODEM makes the computer network possible.

 

Modulation / Demodulation

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. The process of translating analog signals from a phone line and converts then into digital signals for the computer is known as demodulation.

 

Software components of a computer network

a)     Network protocol

b)     Network operating system

c)     Device driver

 

Network operating system [PMT 2075K]
Network operating system is a set of computer program that manages the resources on network. E.g. Novell network, Microsoft Windows NT, Linux, Unix etc.

 

Device driver

Device driver is a program that controls the functionality of the hardware device.

 

Types of Network

a)     LAN (Local Area Network)

b)     MAN (Metropolitan Area Network)

c)     WAN (Wide Area Network)

 

LAN (Local Area Network)

A LAN is a type of network which covers small area i.e. within a room, building, or short distance by using cables or small wireless devices. It is controlled by a single organization. It uses private connection media. E.g.: network in a school, college or cyber cafe. The diameter is not more than a few kilometres. LAN offers bandwidth of 10-100 Mbps.

 

MAN (Metropolitan Area Network)

A MAN is a type of network which covers an entire city. It is controlled by single or group of organization. It uses private or public connection media. E.g.: interconnection between different branches on same branch and ISP providing internet services. It offers a number of network services compatible with bandwidth from 128 kbps to 1 Gbps.

 

WAN (Wide Area Network)

A WAN is a type of network which  connects two or more computers generally across a wide geographical area such as cities, districts, and countries. It is controlled by group of organization. It uses public connections media like telephone lines, satellite links or microwave system to connect several LANs and MANs.  E.g. internet. Data transmission in WAN is slower than LANs and WANs.

 

Network topology (LAN topology)
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.

 

Advantages of bus topology [SEE 2073]

a)     It is easy to set up computers and other devices in bus topology, because all the devices are connected through a single wire.

b)     It requires fewer cable media, so it is cheaper than other topologies.

c)     It is easy to add new node to the network.

d)     Failure of one workstation does not affect other computers on the network.

 

Disadvantages of bus topology

a)     The whole network system collapses if the cable or backbone is damaged.

b)    The network slows down if additional computers are connected.

c)     The limited length of the cable in a network may restrict to connect the workstation or devices.

d)    It is difficult to find fault in this network topology.


Ring topology [MF 2076]

The network topology in which computers are connected in the shape of a circle without any end points is called ring topology. Each workstation contains two neighbours for communication or an input and output connections.

 

Advantages of ring topology

i) It is easy it set up and configure.
ii) Each computer gets equal opportunity to access the network resources.
iii) It supports high data transmission rate.

iv) Performs better than a star topology under heavy network load.

 

Disadvantages of ring topology

i)Failure of any cable or single computers may affect the entire network.
ii) It is difficult to detect the errors.
iii) Adding/removing the devices affect the entire network.

iv) Much slower than an Ethernet network under normal load.

 

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.

 

Advantages of star topology

i) Easy to set up and configure.
ii) Failure of single computer or cable doesn’t affect the entire network.
iii) It is easy to find the fault.
iv) It is easy to extend to network by attaching new devices to the central devices.

 

Disadvantages of star topology

i) It requires more cable in comparison of bus topology so it is more costly.
ii) Failure of central devices (hub or switch) break down the whole system.

 

Network architecture (Models of Computer Network)

The arrangement of the computers on the network which is based on the computing model is called network architecture. Its types are

a)     Centralized computing network

b)     Client / Server Network

c)     Peer to Peer Network

 Centralized computing network

A centralized computing network is a network in which a central host computer performs data processing and storage on behalf of clients. It is different from client server network as client server network consists of at least one server and one or more client as well as client server provides high security of data and other resources.

 

Client/server network

Client/ server network is a type of network architecture that consists of at least one server and one or more clients or workstations, where users do their work. It provides central security administration and the network administrator is responsible for data security and other resources management of the network.

 

Peer-to-peer network

Peer-to-Peer network is a group of computers, which function both as servers and workstations to share data, information and other resources of the network. It lacks centralized network administration, where the 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

 

Client/server network

Peer-to-peer network

There is a specific server and specific clients connected to the server.

Clients and server are not distinguished; each node act as client and server.

The client request for service and server respond with the service.

Each node can request for services and can also provide the services.

The data is stored in a centralized server.

Each peer has its own data.

The client-server are expensive to implement.

Peer-to-peer are less expensive to implement.

 

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. TCP/IP is the communication protocol used by the internet.

 

Services of internet

WWW (World Wide Web), E-mail (Electronic mail), FTP (File Transfer Protocol),

IRC (internet Relay Chat), Search Engine, Telnet, E-commerce

 

Advantages of internet

a)     It provides entertainment, such as movies, music, and games.

b)     It allows people to communicate with each other from all over the world.

c)     It makes it possible to shop for goods and services from the comfort of your home.

d)     It provides instant access to a vast amount of information from all around the world.

 

Disadvantages of internet

a)     Online addiction and excessive screen time can have negative effects on mental and physical health.

b)     The internet is full of viruses and malware that can damage computers and steal personal information.

c)     The internet is a major source of pornography, which can be harmful to children and adults.

d)     Online harassment and cyberbullying can cause emotional suffering and harm to individuals.

 

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 by the employees of the owned organization.

 

Extranet

An extranet is a computer network that allows controlled access from outside for specific business or educational purposes.

 

E-mail (Electronic Mail)
E-mail (Electronic mail) is one of the most popular services provided by the internet which send messages from one computer to another using the internet.
E.g. xyz@gmail.com

Any four sites that provide e-mail services are:

www.yahoomail.com, www.hotmail.com, www.gmail.com, www.outlook.com

 

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
a) Minor mistakes in e-mail address may deliver the mail to wrong address.
b) Since it passes through a vast electronic network, it may be seized in between.

c) Without the internet, e-mail is not possible.

d) Risk of messages getting lost or buried in overflowing inboxes.

 

ISP (Internet Service Provider) 
An Internet service provider (ISP) is an organization that provides services for accessing and using the Internet. World Link, Mercantile, Classitech, Vianet etc are the ISPs of Nepal.

 

Web browser
A web browser is a software that allows users to access and view websites on the internet.  

Examples of web browsers are Mozilla Firefox, Google chrome, Internet Explorer, opera etc.  

 

Search engine
A search engine is a tool that helps to find the information on the internet using keywords or phrases. Examples of search engines are Google, Bing, Yahoo, ask.com etc

 

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.

FTP (File Transfer Protocol)
File Transfer Protocol is the internet tool that allows the user to transfer the file from one computer to another computer. It helps to transfer (download or upload) files from one computer to another computer.

 

Uploading / Downloading
Uploading refers to copying files or documents, programs or data from the user computer to the internet server. Downloading refers to the copying files or document or program or data from the internet server to the user computer.

 

IRC (Internet Relay Chat)
Internet Relay Chat is one of the important services provided by the internet which allows the user to communicate with other people in real time. For eg: chatting on facebook.

 

WWW (World Wide Web)

The World Wide Web (WWW) is a system of interconnected web pages and documents on the internet that can be accessed using a web browser.

 

***


Thursday, May 25, 2023

MODULAR PROGRAMMING 2080 [SEQUENTIAL STRUCTURE] – SEE COMPUTER SCIENCE 2080

  1. Write a program in QBASIC that asks any three numbers and display average and product. Create a user defined function to calculate average and sub program to calculate product.
  2. Write a program in QBASIC that asks any two numbers and display sum and difference. Create a user defined function to calculate sum and sub program to calculate difference.
  3. Write a program in QBASIC that asks any number and display square and cube root of a given number. Create a user defined function to calculate cube and sub program to calculate square root.
  4. Write a program in QBASIC that asks any number and display square and cube root of a given number. Create a user defined function to calculate cube root and sub program to calculate square.
  5. Create a user defined function to calculate simple interest. [I = P* T * R / 100]
  6. Write a sub procedure to calculate distance. DISTANCE = U * T + 1 / 2 * A * T ^ 2
  7. Create a user defined function to calculate area of four walls. A = 2 * H * (L + B)
  8. Write a sub program cost (l,b,h,c) to find the cost of painting the four walls of a room.
  9. Write a sub procedure to calculate area of triangle. A = 1 / 2 * (B * H)
  10. Write a program in QBASIC that asks radius of a circle to calculate its area and circumference. Create a user defined function to calculate area and sub program to calculate circumference.[Hint A=Pr2, C= 2Pr] – SEE 2079
  11. Write a QBASIC Program to read the side of a cube. Calculate its volume using function procedure and calculate surface area using sub procedure. (Hint: vol=side3 and sa=6 side2]
  12. Write a program in QBASIC that ask the radius of circle. Write a program to calculate the area and circumference of a circle. Create a user defined function first (r) to calculate area and sub procedure second (r) to calculate circumference of a circle.
  13. Write a QBASIC program that asks length, breadth, height and calculate volume of Cuboid and Total Surface Area. Create a USER DEFINED FUNCTION to calculate Volume of Cuboid and SUB-PROGRAM to calculate Total Surface of Area. TSA=2*(L*B+B*H+L*H) , VOL=L*B*H
  14. Write a program in QBASIC that asks length, breadth and height of room and calculates its area and volume. Create a user-defined function to calculate area and sub-program to calculate volume. A=L×B, V=L×B×H
  15. Write a program in QBasic that ask the radius and height of a cylinder and calculate the volume and curve surface area. Create a user-defined function to calculate volume and sub-procedure to calculate curve surface area of a cylinder. [Hints: V=Ï€r2h, CSA=2Ï€rh]
  16. Write a program in QBasic that ask the radius and calculate the volume and total surface area. Create a user-defined function to calculate volume and sub-procedure to calculate total surface area of a sphere. [Hints: V=4/3Ï€r2, TSA=4Ï€r2]
  17. Write a program in QBasic that ask the radius and calculate the volume and total surface area. Create a user-defined function to calculate total surface area and sub-procedure to calculate volume of a hemisphere. [Hints: V=2/3Ï€r2, TSA=3Ï€r2]
  18. Write a program in QBASIC to input length and breadth of room and calculate its area using function and perimeter using sub procedure. [Hint: Area = L2. Perimeter = 4×L]
  19. Write a program in QBASIC to input length and breadth and calculate area of square using sub and perimeter using function procedure. [Hint: Area = lxb. Perimeter = 2(l+b)]
  20. Write a program to calculate total surface area of a cylinder using function procedure and volume using sub procedure. [Hint: Total surface area-2pr(r+h), Volume=pr2h] 
  21. Write a program in QBASIC that will asks the user to input length, breadth and height of a room then use SUB procedure calculate its volume and FUNCTION procedure to calculate its area of four walls.
  22. Write a program using Function…..End Function to get temperature in Celsius from the user and then print the temperature in Fahrenheit.(hint: F=9C/5+32)
  23. Write a program to input Fahrenheit and convert it into Celsius using SUB - END SUB. C = (F – 32) * (5 / 9)
  24. Write a program to convert USD(dollar) into NC (NEPALI currency) using DECLARE FUNCTION.
  25. Write a program to convert NC (NEPALI currency) into IC (Indian Currency) using DECLARE SUB and convert NC into Dollar using DECLARE FUNCTION.
  26. WRITE A PROGRAM to ask a number as paisa and convert them into corresponding rupees only solve it using SUB Procedure.
  27. Write a program to input distance in kilometer and convert into meter using function procedure.
  28.   Using FUNCTION……END FUNCTION, write a program to input cost price and selling price from the keyboard to calculate profit and using sub procedure to calculate profit percentage.
  29. Write a qbasic program to calculate loss using sub procedure and loss percentage using function procedure.
  30. Write a program to calculate the area of triangle by using SUB…..END SUB. [Hints: Area= 





Friday, April 14, 2023

Solved SEE 2079 Computer Science

  

Solved SEE 2079 Computer Science

SEE 2079

Opt II. [Computer Science]

1. Answer the following questions in one sentence.

a) What is network protocol?

Ans: A network protocol refers to a set of rules and standards that govern the communication between devices or computers on a network.

b) What is e-commerce?

Ans: E-commerce refers to the buying and selling of goods and services over the internet.

c) What is the default size of text field in MS-Access?

Ans: The default size of a text field is 50 characters in MS-Access.

d) Which data type is used to store photo in MS-Access?

Ans: The data type used to store photos is called an OLE Object data type.

e) What is looping?

Ans: Looping is a programming concept that allows a set of instructions to be repeated multiple times in a program.

f) List any two data types used in C-programming language.

Ans: Any two data types used in C-programming language are char and int.

2. Write appropriate technical term for the following:

a) A program that can disinfect a file from virus. Antivirus software.

b) Learning through the electronic media. E-Learning.

3. Write the full form of the following:

a) G2G – Government to Government

b) ISP – Internet Service Provider

4. Answer the following questions:

a) What is network topology? List any two types of network topology.

Ans: Network topology refers to the physical or logical layout of a computer network. Any two types of network topology are bus topology and star topology.

b) What is antivirus software? Name any two popular antivirus software.

Ans: Antivirus software is a type of program designed to detect, prevent, and remove malicious software (malware) from computers and other devices. Any two popular antivirus software are Kaspersky and Norton Antivirus.

c) Define cyber law and cyber crime.

Ans: Cyber law is a type of law that governs the use of the internet, computers, and related technologies. Cyber crime refers to criminal activities that are committed using computers or the internet.

d) Define virtual reality. Write any two areas where virtual reality is used.

Ans: Virtual reality is a technology that creates a computer-generated environment that users can experience and interact with using specialized hardware such as head-mounted displays. Any two areas where virtual reality is used are Gaming and Education and Training.

e) What is password? Write any two importance of password protection.

Ans: A password is a secret code that you use to verify your identity and access your accounts or devices. Any two importance of password protection are:

- to protect your passwords because it helps to keep your personal information and accounts safe from unauthorized access.

- to ensure security and privacy, as well as prevent hacking, identity theft, and other cybercrimes.

f) What is DBMS? Write four objects of MS-Access.

Ans: DBMS is a software system that helps users to store, retrieve, and manage data in an efficient and organized way. Any four objects of MS-Access are Table, Form, Query and Report.

g) What are validation text and validation rule?

Ans: Validation text is the message that appears when a user enters invalid data into a field. Validation rule is a condition that must be met in order for data to be accepted into a field.

h) What is form? Write any two advantages of it.

Ans: A form is an object of MS-Access which provides a graphical interface that allows users to interact with the data in a database. Any two advantages of form are:

- It provide a user-friendly interface for users to input and display data.

- It can include validation rules that help ensure that data entered into fields meets specific requirements.

i) What is record? Why is primary key necessary in record?

Ans: A record refers to a collection of related data fields that are organized and stored together. A primary key is necessary in a database record because it helps to ensure the accuracy and integrity of data in a database by ensuring that each record is unique and identifiable.

5. Write down the output of the given program:

DECLARE SUB Series(A)

CLS
A=20

CALL Series(A)

END

SUB Series(A)

FOR K=1 to 5

PRINT A;

A=A+10

NEXT K

END SUB

Dry Run

Variable

Variable

Loop Check

Output

A

K

1 to 5

20 30 40 50 60

20

1

1 to 5 yes

 

30

2

2 to 5 yes

 

40

3

3 to 5 yes

 

50

4

4 to 5 yes

 

60

5

5 to 5 yes

 

70

6

6 to 5 no

Loop exits

 

 Output

20 30 40 50 60

6. Re-Write the given program after correcting the bugs:

REM program to make a word reverse

DECLARE FUNCTION Rev$(N$)

CLS

LNPUT “Enter a word”; N$

DISPLAY “Reversed is”; Rev$(N$)

END

EUNCTION Rev$(N$)

FOR K=LEN$(N$) To 1 STEP-1

B$=B$+MID$(N$,1,K)

NEXT K

B$=Rev$

END FUNCTION

Debugged Program

REM program to make a word reverse

DECLARE FUNCTION Rev$(N$)

CLS

INPUT “Enter a word”; N$

PRINT “Reversed is”; Rev$(N$)

END

FUNCTION Rev$(N$)

FOR K=LEN (N$) To 1 STEP-1

B$=B$+MID$(N$,K,1)

NEXT K

Rev$=B$

END FUNCTION

Study the following program and answer the given questions:

DECLARE FUNCTION SUM(N)
CLS
INPUT “Enter any number”; N

X=SUM(N)

PRINT “The sum of individual digit is “; X

END

FUNCTION SUM(N)

WHILE N<>0

R=N MOD 10

S=S+R

N=INT(N/10)

WEND

SUM=S
END FUNCTION

a) Write the function of INT.

Ans: The INT function is used to round down a number to the nearest integer value.

b) How many times does the WHILE ….WEND loop repeat if the value of N is 123?

Ans: The WHILE ….WEND loop repeats 3 times if the value of N is 123.

8. Convert/Calculate as per the instruction:

a) (10110011)2 – (?)16

b) (410)10 = (?)2

c) (1001 + 110)2 – (1000)2

d) (10110)2 ¸ (101)2

9. a) Write a program in QBASIC that asks radius of a circle to calculate its area and circumference. Create a user defined function to calculate area and sub program to calculate circumference.

[Hint A= Pr2, C= 2Pr]

b) A sequential data file called “Record.dat” has stored data under the field headings: Roll No., Name, Gender, English, Nepali, Maths and Computer. Write a program to display all the information of those students whose marks in English is more than 40.

c) Write a program in C language that asks any two numbers and displays the greatest among them.

Write a program in C-Langauge to display the series with their sum. 1,2,3,4….upto 10th terms.