Professional Documents
Culture Documents
SEE C 2076: Omputer Science
SEE C 2076: Omputer Science
SLC 2064 to SEE 2075 SLC 2065 Supplementary Megha, Asia, Benchmark, Ekta,
Questions Solutions to SLC 2075 Upgrade
Question Solutions
Innovative, Read More, Times,
Guniess, Sunrise, Unique,
Vidhyarthi, Sanjiwani
2019/20
Fundamentals Questions - 175 300 Questions / Answers
DBMS Questions - 55 1325 Objectives Q/A
Programming Theory Questions - 70 325 – Qbasic Programs
MCQ - 315
300 – Number System
True or False - 360
Fill in the Blanks - 170
Match the Following - 80
Total: 2250
Technical Terms - 200
Full Forms - 200
Number System - 300
Output - 70
Debug - 35
Analytical - 40
Qbasic programming Solutions - 180
https://seeqbasicomputer.blogspot.com/ 2|Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Fill in the Blanks [20] ................................................................................................................................................... 44
True / False [35] .......................................................................................................................................................... 45
Technical Terms [20] .................................................................................................................................................. 46
Ms-Access ....................................................................................................................................................................... 47
Questions and Answers [55] ....................................................................................................................................... 47
MCQ (Multiple Choice Questions) [80] ....................................................................................................................... 52
Fill in the Blanks [35] ................................................................................................................................................. 55
True / False [100] ........................................................................................................................................................ 56
Match the following – MS Access [30] ...................................................................................................................... 58
Full Forms [200] .......................................................................................................................................................... 60
Match the Following – Fundamentals [50] ................................................................................................................. 64
Modular Programming .................................................................................................................................................... 68
Questions and Answers [25] ....................................................................................................................................... 68
Handling of data file ....................................................................................................................................................... 70
Questions and Answers [25] ....................................................................................................................................... 70
Introduction of C ............................................................................................................................................................. 71
Questions and Answers [20] ....................................................................................................................................... 71
Find Output [70] ............................................................................................................................................................. 73
Debugging [35] ............................................................................................................................................................... 85
Analytical Questions [40] ............................................................................................................................................... 93
Qbasic Programming Questions [180] .......................................................................................................................... 107
Number System [300] ................................................................................................................................................... 128
https://seeqbasicomputer.blogspot.com/ 3|Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Networking and Telecommunication
4. Medium
A path through which the sender makes communication to the receiver is known as medium.
https://seeqbasicomputer.blogspot.com/ 4|Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
11. Transmission medium / Communication Channel [SLC 2070 S] [SEE 2074 U] [MM 2076] [MFT 2075]
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)
https://seeqbasicomputer.blogspot.com/ 5|Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
19. 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.
23. Computer network [SLC 2066] [SLC 2068 S] [SLC 2069 S] [SLC 2070 S] [SLC 2071 S] [SEE 2074]
[MF 2076]
A computer network means two or more computers connected with each other to share data, hardware, software
and other resources.
24. Advantages of computer network [SLC 2065 S] [SLC 2069] [SLC 2071 S] [SEE 2075 S2] [MF 2076]
[MFT 2075]
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.
25. Disadvantages of computer network [SEE 2075 S2] [MF 2076] [MFT 2075]
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.
https://seeqbasicomputer.blogspot.com/ 6|Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
27. Reasons of keeping computers on the network [SLC 2070 S]
a) To share hardware devices like printers, scanners, hard disks etc.
b) To share data, information and programs.
c) To communicate with each other.
29. Computer Network reduces expenses of an office. Justify this statement with an example.
Computer Network reduces expenses of an office because computer on a network share different hardware devices
like printers, scanners, hard disk etc. And sharing those hardware devices will reduces the expense of an office. For
example if there are twenty computers in an office, now for printing the data there is no need to buy twenty printers
individually rather than simple network the computer and connect the printer on the network which helps in
sharing of the one printer among twenty computers which reduces the cost of buying nineteen printers individually.
32. 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.
33. Workstation
Workstation is a computer network that utilizes network resources. Network operating software used by
workstation are Windows 98, Windows XP etc.
34. Node
Each computer or device of network is called node.
https://seeqbasicomputer.blogspot.com/ 7|Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
36. Network Interface Card (NIC) [SQE 2075K]
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.
37. 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.
38. 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.
41. 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.
42. Gateway
Gateway is an interconnecting device that connects two dissimilar networks
43. Repeater
Repeater is a device that amplifies the incoming signals, creates a copy of it and transmits the signal on network.
46. 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.
https://seeqbasicomputer.blogspot.com/ 8|Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
47. Demodulation
The process of translating analog signals from a phone line and converts then into digital signals for the computer
is known as demodulation.
55. Network topology (LAN topology) [SLC 2064] [SLC 2065 S] [SEE 2066 S] [SEE 2067 S] [SLC 2068]
[SLC 2070] [SEE 2072] [SEE 2075U]
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
https://seeqbasicomputer.blogspot.com/ 9|Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
57. Diagram of bus topology [SEE 2067 S] [SLC 2069 S]
https://seeqbasicomputer.blogspot.com/ 10 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
63. 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.
64. Star topology [SLC 2065] [U1]
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.
65. Diagram of star topology [SLC 2064] [SLC 2065] [U1]
https://seeqbasicomputer.blogspot.com/ 11 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
MCQ (Multiple Choice Questions) [85]
1. Data communication means:
a) We can easily send and receive the message b) Data computing system is fastest in network
c) The process of transferring data and information d) None of above
2. The term network basically refers to:
a) Communication b) Interconnection c) Sharing d) All of them
3. Which of the following are is not a goal of computer networks?
a) Resource sharing b) High reliability c) Scalability d) None of the above
4. Which one of the device is simplex?
i. Television ii. Telephone iii. Computer iv. Walkie-Talkie
5. TV broadcasting is an example for data transmitting
i. Half-duplex Mode ii. Simplex Mode iii. Full duplex mode iv. None of them
6. Which refers to the communication media: [SLC 2065] [SLC 2071 S] [SLC 2064]
a) UTP Cable b) Fiber optics cable c) Satellite d) All of above
7. Which is not a communication media? [SEE 2075 U]
a) NOS b) Satellite c) Infrared d) STP
8. Which is not a communication media? [SLC 2067]
a) Wire b) Microwave c) Satellite d) NIC
9. Which is not unguided media? [SLC 2069]
i) Fiber optics ii) Microwave iii) Infrared iv) Radio wave
10. Which is NOT a guided media? [SLC 2066 S]
i) UTP Cable ii) STP Cable iii) Satellite iv) Fiber Optics
11. Which of the following is not a guided data communication media? [SLC 2068 S]
i) Coaxial cable ii) Fiber optic iii) twisted pair iv) Satellite
12. Which transmission media is not used for guided transmission media?
a) Fiber Optic b) Coaxial Cable c) RJ45 d) Satellite
13. Which one is an example of bounded media? [SLC 2067 S] [SLC 2070] [MFT 2076]
i) Fiber optics ii) Microwave transmission iii)Laser transmission iv) infrared transmission
14. Which one is an example of unbound media? [SLC 2071 S]
i) UTP cable ii) Microwave transmission iii) Fiber optic cable iv) All of the above
15. Unbounded communication medium is ......... [MFT 2075]
i) Satellite ii) Dial Up iii) Fiber Optics iv) UTP
16. An example of guided media_______
a) Radio wave b) Infrared c) Fiber Optics d) Micro wave
17. In which communication media data transfer high? [SLC 2068]
i) Twisted pair ii) Co-axial cable iii) Fiber optics iv) Microwave
18. Fastest and high bandwidth data communication medium is: [SEE 2074 U]
a) Optical fiber b) Twisted Pair c) Coaxial Cable d) Telephone Line
19. Media used to transfer data in forms of light? [SLC 2070 S]
i. Microwave ii. Fiber optical iii. Radio wave iv. Satellite
20. Microwave and Infrared technology are related with:
a) Unbounded media b) Bounded Media c) Confounded d) Hot Bounded
21. A form of wireless transmission in which signals are sent via pulses of infrared light.
i) Radio networking ii) Infrared transmission iii) Microwave transmission iv) None of the above
22. Which is the connector of UTP cable?
i. BNC ii. T-Connector iii. ST connector iv. RJ-45 connector
23. Which is the connector of coaxial cable.
i. RJ 45 ii. BNC iii. ST iv. None of them
24. Which of the following is not Media connector?
i. BNC ii. terminator iii.RJ-45 iv.NIC
https://seeqbasicomputer.blogspot.com/ 12 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
25. The device used for connecting PC to telephone line is
i) CD-ROM ii) MODEM iii) Printer iv) Port
26. A device that converts the discrete stream of digital ON-OFF electric pulses used by computer into the
continuously variable analog wave patterns used to transmit the human voice over many existing telephone lines.
i) Modem ii) Bridge iii) Gateway
27. In binary number systems 1 and 0 means ........ [SEE 2074 U]
(i) ON, OFF (ii) YES, TRUE (iii) OFF, NO (iv) YES, ON
28. Modem converts ______________ [SLC 2066 S]
a) Sound into digital b) Digital signal into sound c) Both (i) and (ii) d) None of above
29. The process of converting analog signals into digital signals [MFT 2076]
a) Modulation b) Demodulation c) Both d) None
30. The process of converting digital signals into analog signals. [MFT 2075]
i) Modulation ii) Demodulation iii) Both i) and ii) iv) None of them
31. The speed of Modems is measured in terms of
i. mbps ii.bps iii. kbps iv. bits
32. Which device is used to connect multiple networks that uses the same protocol. [SLC 2074]
(i) Bridge (ii) NIC (iii) Switch (iv) Gateway
33. Which of the following is used to connect totally dissimilar networks?
i) Router ii) Bridge iii) Gateway iv) None of the above
34. A networking device that joins multiple networks having different protocols is_ [MFT 2076] [MFT 2075]
i. Switch ii. Router iii. Gateway iv. Bridge
35. Which is not a network device?
a) Hub b) Repeater c) Switch d) TCP/IP
36. Which is not a physical component of computer network ?
i) Cable ii) NIC iii) Network OS iv) Hub
37. Which is not network hardware component?
i. HUB ii. Repeater iii. Router iv. Windows NT
38. The hardware components of a network. [MM 2076]
i) NOS ii) LAN iii) Switch iv) All of them
39. Which is the component of a network?
i. MSDOS ii. Hub iii. Volt guard iv. None of them
40. A network device that amplifies the incoming signal creates a new copy of it and transmits. [MM 2076]
a) Hub b) Bridge c) Repeater d) Router
41. A network navigation device that merely retransmits a signal to all other nodes attached to it:
a) Router b) NIC c) Hub d) Adapter
42. A device that lets you link two networks together.
i. Switch ii. Hub iii. Router iv. None of above
43. NIC is a ....... [SEE 2073 U]
(i) Software (ii) Hardware (iii) HUB (iv) Network operating system
44. Which of the following device is multi ports repeater?
a) Hub b) router c) bridge d) Gateway
45. Any network device that can connect to the network and can generate ,process or transfer network data.
a) Node b) Client c) Peer d) None
46. A __________ is the card that physically makes the connection between the computer and the network cable.
a) Network cables b) Network connector c) NIC d) None
47. Which is not the network operating system:
a) Linux b) UNIX c) MS-DOS d) Windows Server 2012
48. Which is Network operating system(NOS)? [SLC 2064]
a) Linux b) Windows XP c) MS-DOS d) All
49. Which is the network operating system used in a server computer?
a) Windows XP b) Windows Vista c) Windows NT server d) None of them
https://seeqbasicomputer.blogspot.com/ 13 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
50. Which one is an operating system software? [SLC 2070]
a) MS-Word b) MS-Excel c) Firefox d) MS-DOS
51. Protocols in network means
a) Language for b) Rules for exchange of c) Both d) None of the above
communication message between two
between computer or more hosts
52. Which of the following is not a protocol? [SLC 2068] [SLC 2074]
a) POP b) TCP/IP c) NOS d) FTP
53. Which is not a network protocol?
a) TCP/IP b) HTTP c) LAN d) FTP
54. Which of the following is not a protocol?
a) TCP/IP b) IPX/SPX c) NETBIOS/NETBUI d) Client
55. Which is not the network protocol? [SQE 2074K]
a) TCP/IP b) STP c) FTP d) SMTP
56. Which is not a protocol? [SEE 2073 U]
a) FTP b) POP c) HTTP d) TIP
57. Which of the following is protocol?
a) TCP/IP b) HTTP c) FTP d) All of them
58. The communication protocol used to connect to web servers on the internet or on a local network (intranet).
a) TCP/IP b) HTTP c) SMTP d) POP
59. _______ is the protocol used to send email:
a) HTTP b) SMTP c) POP d) FTP
60. Which protocol is used to receive mail from mail server?
a) POP b) FTP c) HTTP d) SMTP
61. Which of the following networking solution is suitable for networking within a building?
a) WAN b) LAN c) MAN d) None of above
62. A network of computer spread over a city or town located in the same geographical area.
a) LAN b) MAN c) WAN d) CAN
63. A telecommunication network, usually used for connecting computers, that spans a wide geographical area.
a) LAN b) MAN c) CAN d) WAN
64. Connection of computer between two different cities. [MFT 2076]
a) WAN b) MAN c) WLAN d) Wi-Max
65. Connection of computer between two different countries. [MFT 2075]
a) WAN b) MAN c) WLAN d) Wi-Max
66. Which type of network is used in the internet?
a) LAN b) MAN c) CAN d) WAN
67. Which of the following topologies share a single channel on which all stations can receive and transmit the data?
a) LAN b) BUS c) TREE d) None of the above
68. Physical structure of computer network. [SEE 2075]
a) protocol b) Topology c) MAN d) cabling
69. Which is not a network topology? [SLC 2066]
a) STAR b) Ring c) Client / Server d) BUS
70. In ......... Network Topology, nodes are connected in a single wire. [SEE 2073 U]
a) Star b) Bus c) Mesh d) All of the above
71. Which of the following topologies is least affected by addition/removal of a node?
a) Star b) Ring c) Bus d) None of the above
72. In which topology network devices are connected through hub? [SLC 2067] [SEE 2075] [PMT 2075]
a) Ring topology b) Bus topology c) Star topology d) None of the above
73. Token passing system is used in _____ topology.
a) Star b) Ring c) Bus d) Mesh
74. The network architecture used in most home networks is:
a) Client-server LAN b) Peer-to-peer LAN c) Client-server WAN d) Peer-to-peer WAN
https://seeqbasicomputer.blogspot.com/ 14 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
75. A _______ is a self-sufficient computer that acts both as a server and a client to other similar computers on the
network.
a) Node b) Client c) Peer d) None
76. A group of computers that functions both as a client and as a server.
a) Centralized b) Client/server c) Peer-to-peer d) Local Area Network
computing
77. In which of the following network model all the computers have equal access?
a) Peer-to-peer b) apple talk network c) Client/server network d) None of the above
network
78. A specialized network device on a host-based network that transmits the data entered by the user to the host for
processing and displays the results.
a) Client b) Network Server c) Terminal d) None of the above
79. A centralized computing network is a type of network where all the users connect to a host computer that is the
acting agent for all communication.
a) Peer-to peer b) Client/server c) Both d) None of the above
80. A network in which a central host computer performs data processing and storage on behalf of clients.
a) Centralized b) Client/Server network c) Peer-to-peer network d) None
computing network
81. Which of the following acts as the central authority in the network?
a) protocol b) client c) server d) none of the above
82. A server in LAN is a
a) Device offering b) NIC c) Workstation with huge d) None of the above
service to user secondary storage
83. A dedicated server that manages printers and printing jobs is_
a) Network Server b) Printer Server c) Modem Server d) File Server
84. The maximum speed at which data can be transmitted between two nodes on a network.
a) Bit rate b) Bandwidth c) Band length d) None of them
85. The bandwidth of digital signal is measured in_
a) Hertz b) Cycle per second c) Bits per second d) None of the above
https://seeqbasicomputer.blogspot.com/ 15 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
15. A set of rules used to define communication is called protocol.
16. Protocol is a set of rules that governs the communications between computers on a network.
17. The smallest area covers by network is called LAN
18. The network of computer within the room, building or campus is LAN.
19. A MAN is a network that interconnects users with computer resources in a geographic area or region larger than
that covered by even a LAN but smaller than the area covered by a WAN.
20. The computer network of any two countries is WAN.
21. The example of WAN is internet .
22. HUB is a hardware device used to connect several computers together.
23. Router is a device connecting two or more networks that facilitates the transfer of data in the form of packets.
24. Gatewayis a device software or a system that converts data between dissimilar network with different protocols.
25. Simplex mode communication is a mode of transmission in which data flows in one direction only.
26. Modes for transmitting data from one device to another are simplex, Half-duplex, and full-duplex mode.
27. Full-duplex mode means two-way communication system. [SLC 2064]
28. Bandwidth is measured in bits per second.
29. A topology refers to the shape of the network in which all the computers are connected together.
30. A physical ring topology is a network topology in which network nodes are connected in a continuous circle.
https://seeqbasicomputer.blogspot.com/ 18 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Internet and Its Services
Questions and Answers [40]
1. Internet [SLC 2065 S] [SLC 2066] [SLC 2069] [SLC 2069 S] [SLC 2071 S] [SEE 2074] [MFT 2075]
[PMT 2075K]
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.
2. Who controls internet?
Different organization like ISOC (Internet Society), W3C (World Wide Web Consortium), IAB (Internet
Architecture Board), IEFT (Internet Engineering Task Force), IRTF (Internet Research Task Force), IESG (Internet
Engineering Steering Group) and INIC (Internet Network information Centre) gives directive and guideline for the
proper use of internet.
3. Internet called Network of networks [PMT 2075K]
The internet is called ‘network of networks’ because all the smaller networks of organizations are linked together
into the one giant network called the internet.
4. Protocol used by the internet.
TCP/IP is the communication protocol used by the internet.
5. Components required for internet connection
a) A TCP/IP enabled computer with web browser
b) An account with an ISP
c) Router / MODEM (necessary if you are using a telephone line to access the Internet)
6. Connection (ISDN, Satellite, cable and dial-up)
Types of internet connection [SQE 2074K]
i) Dial Up Connection
ii) ADSL Connection
iii) Fiber Connection
https://seeqbasicomputer.blogspot.com/ 19 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
11. 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.
12. Extranet
An extranet is a computer network that allows controlled access from outside for specific business or educational
purposes.
13. 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.
E-mail (Electronic Mail) [SLC 2068 S] [SLC 2069 S] [SEE 2075 S2] [MM 2076] [MFT 2075]
E-mail (Electronic mail) is one of the most popular services provided by the internet which exchanges messages
between the computers through a network. It is the soft copy service of the internet.
E-mail can be sent using a computer with modem, e-mail program and internet facility.
E.g. xyz@gmail.com
Any four sites that provide e-mail services are:
a) www.yahoomail.com
b) www.hotmail.com
c) www.gmail.com
d) www.outlook.com
14. Advantages of E-mail [SEE 2067 S] [SLC 2070] [SEE 2073 U] [MM 2076] [MF 2076] [MFT 2075]
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.
15. 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.
16. E-fax (Electronic Fax)
E-fax is the service of the internet through which a user can send and receive faxes(documents or graphics) directly
from a computer to another computer. It is the hard copy service of the internet. E-fax can be sent using a computer
with modem, e-fax program and internet facility.
17. Newsgroup
Newsgroups are discussion groups that focus on a particular topic such as politics, health, computer, etc. The
interested people on the particular field write the information or articles. Then these articles are posted to the
newsgroup so that other people can read them.
18. 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.
https://seeqbasicomputer.blogspot.com/ 20 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
22. Downloading [MF 2076] [MFT 2075]
Downloading refers to the copying files or document or program or data from the internet server to the user
computer.
23. IRC (Internet Relay Chat) [MFT 2075]
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.
It uses the browser software without using special chat software. It communicates only text.
For eg: chatting on facebook.
24. Internet telephony
Internet telephony is one of the cheapest and reliable services provided by the internet that allows the user to make
telephone communication or voice communication through internet.
25. FAQ (Frequently Asked Questions)
FAQ (Frequently Asked Questions) is an online document that possesses series of common questions and answers
on a specific topic.
26. E-commerce (Electronic commerce) [SLC 2069]
E-commerce is one of the popular service of internet which helps in buying and selling of goods over the internet.
It is doing business online through the internet.
Any two e-commerce websites are:
https://www.daraz.com.np/
https://muncha.com/
27. 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 eg: chatting on skype.
28. Online banking
Online banking is the practice of making transaction using the internet.
29. Webpage
Webpage is an electronic document written using a computer language which contain information about any
person ,organization, etc is called HTML.
30. Website
Website is a collection of web pages that can be published by an organization or individual.
It contains home page and other sub pages.
31. HTTP (Hyper Text Transfer Protocol)
HTTP is a protocol used by the WWW to establish client and server interactions.
32. Web browser [SEE 2075 U] [SLC 2067] [MF 2076]
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.
33. URL (Uniform Resource Locator)
Ans: URL is a unique address that provides location of a webpage on the internet.
Example of URL: http://www.abc.com/mainpage/first.html
http: protocol name, www.abc.com: server name, mainpage: path, first.html: filename
34. Search engine [SEE 2074 U] [SQE 2075K]
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 locate specific
sites and information. Examples of search engines are Google, Bing, Yahoo etc
https://seeqbasicomputer.blogspot.com/ 21 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
35. 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.
36. Wi-Fi (Wireless Fidelity)
Wi-Fi is the name of a popular wireless networking technology that uses radio waves to provide wireless high-
speed Internet and network connections.
37. ISDN (Integrated Services Digital Network)
ISDN is a high speed digital communication network involving from existing telephony integrated digital network
(IDN) which provides end to end digital connectivity to support a wide range of services including voice and non-
voice service.
38. WWW (World Wide Web)
The World Wide Web (abbreviated WWW or the Web) is an information space where documents and other web
resources are identified by Uniform Resource Locators (URLs), interlinked by hypertext links, and can be accessed
via the Internet.
39. DNS (Domain Name System)
Domain Name System is an Internet service that translates domain names into IP addresses.
40. Social Networking Websites
Social networking websites are online communities in which member interact. Eg. Facebook, Twitter, Instragram etc.
https://seeqbasicomputer.blogspot.com/ 22 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
17. Email is
i. Mail concerning electronic devices
ii. Transaction of letters, messages and memos over a communication network.
iii. Transaction of messages within a computer. Iv. None of them.
18. E-mail is a/an …………… [SLC 2067 S]
a) organization which b) protocol to access c) service of Internet d) none
controls internet internet
19. Which is the correct Email ID? [SLC 2065]
a) Yahoo@ramesh b) Ramesh@yahoo.com c) @ramesh.yahoo.com d) None of the above
20. In an email address : abc@yahoo.com, what does ‘yahoo’ refer?
a) User account name b) Domain name c) Top level domain name d) None of them
21. Which of the following is online business?
a) E-Commerce b) E-shopping c) E-Business d) All of the above
22. E-commerce is ………….[SLC 2067 S] [SLC 2071 S] [SQE 2074K]
a) a type of business b) a type of virus c) Both d) None of the above
23. Each web page has its own unique address known as
a) Uniform Resource b) Universal Resource c) Uniform Resources d) Universal
Locator Locator Locator Resources Locator
24. Which of the following allows the user to surf and interact with the web-page?
a) website b) Browser c) web page d) web server
25. Which is web browser software? [SLC 2067]
a) Windows 2007 b) Internet explorer c) Windows NT d) All of the above
26. Web sites that allow the users to search information based on keywords or a combination of keywords.
a) World Wide Web b) Electronic mail c) Search engines d) E-Commerce
27. Which is not the search engine?
a) Yahoo.com b) Google.com c) Bing.com d) Ebay.com
28. Yahoo! Is a ……..
a) browser b) home page c) search engines d) None
29. Opera and Firefox is a/an................. [SQE 2075K]
i. chat program ii. Web browser iii. search engine iv. None of the above
30. FTP is used to
a) Browse the Internet b) Send emails c) transfer files from one d) None of above
computer to another
31. Used to transfer file from one computer to another computer in Internet. [SLC 2070 S]
a) FAQ b) IRC c) FTP d) TPF
i. ii. iii. iv.
32. Which of the following is remote login service? [SLC 2068 S] [SLC 2071]
a) Video conferencing b) Telnet c) FTP d) TCP/IP
33. A web site in the internet that brings people together in central location to talk, share ideas, share
interests, make new friends.
a) USENET b) Social network c) Web chat d) None
34. An online interactive communication mechanism that lets people to make a real time decision with one or more
people through the Internet.
a) Web chat b) Newsgroup c) Videoconferencing d) E-commerce
35. The service of the Internet that provides audio and video conversation is_
a) Chat b) . E-mail c) Video conference d) Video chat
36. The process of transferring file from a remote computer to local computer is:
a) Uploading b) Downloading c) Searching d) File transfer protocol
37. The process of transferring file from a local computer to internet is:
a) Uploading b) Downloading c) Searching d) File transfer protocol
38. Web-site is a collection of
a) HTML documents b) Graphics File c) audio and video files d) All of above
39. A technology that allows the creation of collaborative web sites.
a) Wiki b) E-Mail c) . Search Engine d) All of above
40. A set of interconnected WebPages, usually including a homepage, generally located on the same server, and
prepared and maintained as a collection of information by a person, group, or organization.
a) Web site b) Web Browser c) Web server d) None of above
https://seeqbasicomputer.blogspot.com/ 23 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Fill in the Blanks [30]
1. Internet is an interconnection of several computers of different types belonging to various network all over the world.
2. The Internet is network of networks.
3. The Internet began life in 1969 when the United States Department of Defense started a network called
ARPA net
4. The internet originated from an experimental network called ARPAnetcreated in 1969.
5. World Wide Web is also known as internet.
6. Dial-up internet access requires MODEM and telephone.
7. A web site is the collection of web pages.
8. Each page of information is known as web page
9. Each web sites is identified by the URL.
10. The main page of the website is called homepage.
11. Web server are computers that deliver (serves up) Web pages.
12. Windows Internet Explorer and Netscape Navigator are two popular web browser.
13. Web browser is software that allows the user to surf the information through the Internet.
14. HTTP is a set of standards that allow users of the World Wide Web to exchange information found on web pages.
15. The WWW is the leading information-exchange service of the Internet.
16. Search engine are online services that allow users to scan the contents of the Internet to find Web sites or specific
information of interest to them.
17. On the Internet, a search engine is a coordinated set of programs that receives your search request, compares it to
the entries in the index and returns result to you.
18. E-mail is defined as the exchange of message and computer file between computers over a computer network.
19. Web chat on the Internet has become a popular way for people to connect online in a group(a chat room) to share
similar interests.
20. IRC is an online textual communication with each other in real time.
21. The remote login protocol is telnet and file transfer protocol is FTP.
22. FTP is a protocol used to upload and download information.
23. E-commerce refers to the buying and selling of things over the Internet.
24. Broadband can be simply defined as a fast connection to the internet that is always on.
25. Wi-Fi refers to wireless networking technology that allows computer and other devices to communicate over a
wireless signal.
26. Wi-max is a standard for high speed broadband internet access over a wireless connection.
27. Usenet is a collection of user-submitted notes or messages on various subjects that are posted to servers on a
worldwide network.
28. Video conference is a live video connection between people in separate locations for the purpose of
communication or interaction.
29. Social network is a web site on the Internet that brings people together in a central location to talk, share ideas,
share interests, make new friends, etc.
30. The process of transferring a copy of a file from a remote computer to the requesting computer is called
downloading.[SLC 2064]
https://seeqbasicomputer.blogspot.com/ 24 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
10. US government controls the Internet. False
11. ARPANET was the first computer network. True
12. The seeds of today’s Internet were planted in 1959, when U.S. Department of Defense sponsored a project
named ARPANET. False
13. The World Wide Web uses a protocol called TCP/IP. False
14. TCP/IP is responsible for ensuring that the packets are sent to the right destination. True
15. TCP is responsible for ensuring that the packets are sent to the right destination. False
16. The web uses HTTP protocol to transmit data. True
17. A person can reverse the room in a hotel and even purchase goods by using his computer. True
18. WWW is an organization which controls the internet. [SLC 2073] False
19. Web documents contain graphics, sounds, text and video. True
20. FTP is document that allows you to log into another computers on the Internet. False
21. Usenet messages are stored on central computers. True
22. The Internet provides facility for posting messages on various subjects on the newsgroup. True
23. FTP is used to transfer file from one computer to another. True
24. Communication between all the different devices on the internet is made possible by FTP. False
25. Downloading is process of sending files from your computer to another computer on the Internet. False
26. E-commerce is buying and selling products services online. True
27. Probably the most common web-based resources available through Telnet is library catalogs. True
28. Telnet allows you to remote computers (called hosts) over a TCP/IP network (such as the internet). True
29. DNS is used to convert domain name into IP address. True
30. Websites have their own uniqueness address known as United Resource Locator. False
31. Chatting only supports voice messages. False
32. A search engine allows you to search web sites on the net as specified. True
33. The method of locating information on the internet involves the use of search engine. True
34. ISP provides the Internet service to end users. True
35. Google chrome is a search engine. False
36. Web servers are stored in websites. False
37. Dial-up connections involves large volumes of information being carried at high speeds to your PC. False
38. DNS represents a powerful internet technology for converting domain names to IP address. True
39. Wiki is a technology that allows the creation of collaborative web sites. True
40. Web server is a set of interconnected web pages. False
41. Wi-Fi refers to wireless networking technology that allows computers and other devices to communicate over a
wireless signal. True
42. Web chat is a live video connection between people in separate locations for the purpose of communication or
interaction. False
43. People can send or receive email through the IRC. False
44. You can send only text message through the Internet. False
45. Social network is a web site on the Internet that brings people together in a central location to talk, share ideas,
share interests, make new friends etc. True
46. You can send mail through internet but cannot receive the mail. False
47. We will use IRC to make real time communication. True
48. Electronic mail contains a large collection of linked text , image, sound and video files. False
49. Fire wall programs allow workgroups to use the internet to see each other’s face in small window on
the computer screen and to hear their voice through speakers. False
50. A web page can have only textual information. False
https://seeqbasicomputer.blogspot.com/ 26 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Computer Security
Questions and Answers [20]
1. Computer security [SLC 2067] [SLC 2069] [SLC 2070 S] [SEE 2073] [SEE 2074 U] [SEE 2075 S2]
The security given to the computer for the protection of hardware, software and data from being lost or damaged
due to accidental or intentional harm is known as computer security. The types of computer security are hardware
security and software security.
2. Objectives of computer security
a) Confidentiality refers to protecting information from being accessed by unauthorized parties. In other words,
only the people who are authorized to do so can gain access to sensitive data.
b) Integrity refers to ensuring the authenticity of information—that information is not altered, and that the source
of the information is genuine.
c) Availability means that information is accessible by authorized users.
3. Possible threats to computer security [SLC 2069 S]
a) Human error c) Computer crime e) Natural disasters
b) War and terrorist activity d) Hardware failure
4. Hardware security [SLC 2066] [SEE 2066 S] [SLC 2068 S] [SLC 2071 S]
The securing hardware components of the computer system from being damaged or lost due to electrical voltage
fluctuation, extreme temperatures, dust, high humidity or mechanical stress is known is hardware security.
5. Some of the hardware security measures [SLC 2064] [SLC 2065] [SEE 2067 S] [SLC 2070 S] [SLC 2071]
a) Regular maintenance of computer hardware
b) Fire detectors
c) Insurance Policy
d) Use grille in the windows and use lock in the door to protect from thieves
e) Use power protection device to protect computer from power fluctuation.
f) Use vacuum cleaner to clean the room and avoid dust
g) Protect computer from rain water, moisture and other natural calamities
6. Software security [SLC 2065 S] [SEE 2066 S]
The security given to the software and data from being lost or damaged due to accidental or intentional harm is
called software security. Software prevents the data loss by
a) Antivirus software can detect and remove virus from the computer.
b) Scan disk checks folders, bad sector and other error of the disk and fix them.
c) Software for backup helps in securing the information by keeping backup.
7. Some of the software security measures [SLC 2065] [SLC 2065 S] [SLC 2068] [SLC 2069] [SLC 2071 S]
a) keep the backup copy of important data or software
b) Scandisk
c) Defragmentation
d) use Password
e) use antivirus software and update frequently
f) use firewall to prevent virus.
8. Voltage regulator device
A voltage regulator device is an electronic regulator device designed to automatically maintain a constant voltage
level.E.g.: UPS, Spike guard, Volt guard, etc.
Power protection device
The device that provides clean AC power to sensitive electrical equipment are called power protection devices.
Examples are: UPS, Volt Guard, Spike guard, etc.
Power protection device is needed in a computer system to protect the computer system from damage and
expensive data loss.
9. Importance of power protection device [SEE 2074]
i) To protect the hardware against damage from unexpected power failures.
ii) To protect files and programs being corrupted due to sudden power failure.
https://seeqbasicomputer.blogspot.com/ 27 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
10. Surge Protector
Surge protector is a device that shields computer and other electronic devices from surges in electric power or
transient voltage, that flow from the power supply.
11. UPS (Uninterruptible Power Supply)
A UPS is a device that allows computer to keep running for at least a short time when the primary power source is
lost. It provides continuous power supply to the computer system and protects them from power surge and voltage
fluctuation.
12. Importance of UPS [SLC 2070]
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.
13. Regular Maintenance [SQE 2075K]
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 they cause several damages.
14. Fire detectors
Fireguards and fire extinguisher should be installed to protect computer system from fire. Alarms, security lighting
and closed circuit television cameras should be used to protect computer system from theft.
15. Air Condition [SQE 2074K]
Computer system needs air conditioned room because the factor of climate such as temperature and humidity can
pose a threat to computer security. Extremely heat can cause failure of electronic components. Excessive or very
low humidity can also have an adverse effect on the computer equipment. This leads to a reduction in the life span
of equipment. So, a good air conditioning system is required to eradicate heat-related failures.
16. Password
A password is a secret word or phrase that gives a user access to a particular program or system. 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 and memorized.
Any four criteria for strong password are:
a) Do not keep a password which can be easily guessed such as date of birth, nickname, etc.
b) Do not keep word as password that is currently popular.
c) Keep a password with mixture of alphabet and numbers which is difficult to guess.
d) Keep changing your password regularly.
How Password secure the data? [SEE 2075]
Password secures the data by protecting the data from unauthorized access.
17. Password policy
A set of rules designed to enhance computer security by encouraging user to employee strong passwords and use
them properly is called password policy.
18. Backup [SEE 2075 U]
Backup is a copy of a file which is used in the event of the original file being corrupted. Backup is essential to
computer security system to recover the important data and programs from accidental and intentional harm. They
are stored in different storage devices like hard disk, CDs and pen drives. When the data and software gets lost or
damaged the backup system helps to recover the lost or damaged data or software from the backup copy of data
and software.
19. Scan disk
Scan disk is a process which involves in maintaining the disk files and folders, bad sectors, lost clusters, lost chains
and other errors of the specific disk and it can fix them if it is possible.
20. Defragmentation [U1]
The process of re-writing parts of a file to continuous sector on a hard disk to increase the speed of access and
retrieval is called defragmentation.
Fragmentation
The scattering of the parts of the same disk file over different location is called fragmentation.
https://seeqbasicomputer.blogspot.com/ 28 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
MCQ (Multiple Choice Questions) [30]
1. The term computer security refers to:
a) Use of antivirus b) Protection of software c) Protection to a d) Use of firewall
computer system
2. Common computer security is
a) Hardware Security b) Software security c) Hardware & d) None of them
software security
3. _______ protect the machine and peripheral hardware from theft, electronic intrusion and damage.
a) Information security b) Hardware security c) Software security d) None of the above
4. Some of the methods of hardware protection are:
a) Fire Alarms b) Security Lighting c) Closed-circuit d) All of above
cameras
5. Some of the methods of hardware protection are: [SQE 2075K]
a) Password policy b) Security lighting c) Scandisk d) All of the above
6. Which of the following is not hardware security method?
a) Insurance b) Maintenance c) Closed-circuit d) Hard lock key
cameras
7. Hardware security includes
a) Regular maintenance b) Use of power of c) Both d) None of them
regulator devices
8. Which is not the power protection device?
a) UPS b) Spike Guard c) Volt Guard d) Scan disk
9. Which of the following is not power supply device?
a) Volt guard b) UPS c) Constant Voltage d) Power Plug
Transformer
10. A device that protects your PC against power surges and spikes.
a) UPS b) Voltage Regulator c) Surge suppressor d) All of the above
11. An electrical regulator designed to automatically maintain a constant voltage level.
a) UPS b) Voltage regulator c) Surge processor d) All of the above
12. UPS is a
a) Voltage filtration b) Voltage processing c) Voltage regulator d) None
device device device
13. ……….. is a device that allows your computer to keep running for at least a short time when the primary power
source is lost.
a) UPS b) Voltage regulator c) Surge processor d) All of the above
14. To prevent the loss of data during power failures, we use:
a) Encryption program b) Surge protector c) Firewall d) UPS
15. Which device protects hardware? [SLC 2068]
a) UPS b) MODEM c) Gateway d) All of the above
16. The temperature in computer system should be maintained between ______to________ [SQE 2075K]
a) 21`C to 24`C b) 20`C to 25`C c) 23`C to 28`C d) None of the above
17. The temperature in the computer system should be maintained between ………. and ……….
a) 68 to 72 degree b) 88 to 78 degree c) 68 to 27 degree d) All
Fahrenheit Fahrenheit Fahrenheit
18. The type of security that provides barriers and other cyber –tools that protect programs, files and the information flow
to and from a computer.
a) Computer security b) Hardware security c) Software security d) None of the above
19. Which of the following is not software security measure?
a) Virus Scanning b) . Scandisk c) Password d) Security Guard
20. Data and software security includes
a) Protection from b) Cover the computer c) Both d) None of them
computer virus property
21. _____ is a device that protects your PC from computer virus. [PMT 2075]
i. UPS ii. Voltage regulator iii. NAV iv. None of them
https://seeqbasicomputer.blogspot.com/ 29 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
22. An important counter measure against data corruption or loss. [SQE 2074K]
a) Password policy b) Defragmentation c) Scan disk d) Backup system
23. Which of the following measure allows to protect computers being opened from unauthorized user?
a) Antivirus program b) Password c) Debug d) program
24. Scan disk is used for
a) Removing virus b) Removing bad clusters c) Backup data d) All of above
25. Scan disk is performed by using
a) Application software b) Operating system software c) Utility software d) None
26. Backup is way of
a) Securing data and b) Securing internal part c) Securing external d) None of them
information of the computer parts of the computer
27. _________ refers to the condition of a disk in which files are divided into pieces scattered around the disk.
a) Fragmentation b) Defragmentation c) Scan disk d) All of the above
28. Process of arranging the scattered parts of file into a contiguous manner. [SLC 2068 S] [SLC 2071] [SLC 2074]
a) Backup b) Defragmentation c) Debugging d) All of the above
29. The process of loading the noncontiguous fragments of data, rearranging the fragments and restoring them into
fewer fragments or into the whole life.
a) Fragmentation b) Defragmentation c) Scan disk d) None
30. Defragmentation is a process of
a) Formatting the disk b) Relocation of the disk c) Relocation of the d) None of them
files of the disk
https://seeqbasicomputer.blogspot.com/ 31 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Computer Virus
Questions and Answers [15]
1. Computer virus [SLC 2064] [SLC 2068 S] [SLC 2069] [SEE 2074] [SQE 2074K]
Computer virus is a type of computer program which is written by the programmer with the intent of destroying or
damaging the data and programs residing in the computer system. E.g. C-Brain, Frodo, Disk Killer, I Love You etc
The purpose of creating computer virus are:
a) To stop computer piracy
b) To entertain user by displaying interesting message and pictures
c) To destroy data, information and files
d) To expose the programmers ability
e) To earn money
4. Symptoms of computer virus [SLC 2067] [SLC 2068] [SLC 2070 S] [SEE 2072] [SEE 2074] [SEE 2074 U]
a) Program takes long time to load.
b) Increased use of disk space and growth in file size.
c) Corrupting the system data.
d) Renaming files with different names.
6. Preventive ways to protect computer system form virus [SLC 2066] [SEE 2066 S] [SEE 2073] [SEE 2075]
[SEE 2075 U] [SQE 2075K] [U1]
a) Write protect your floppy disks when using them on other computers.
b) Scan the mail or unknown files of internet before opening in your computers.
c) Use a good antivirus program to scan floppy disk, CD, etc. before copying.
d) Don’t install pirated software, especially computer games.
e) Don’t interchange the internal disk among the computers.
https://seeqbasicomputer.blogspot.com/ 32 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
8. Antivirus software [SEE 2073 U] [SLC 2071 S] [SLC 2065] [SLC 2065 S] [SEE 2067 S] [SLC 2069 S]
[PMT 2075K]
Antivirus software is software designed to detect and remove virus from computer system and ensures virus free
environment. E.g. Kaspersky, NAV, MSAV, McAfee, NOD 32 etc.
https://seeqbasicomputer.blogspot.com/ 33 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
8. Which one is not a type of virus? [SLC 2067 S] [SLC 2070] [SLC 2071 S] [SQE 2074K]
i) Message Carrying virus ii) Boot sector virus iii)System virus
iv)Special Purpose Application Infector
9. Route of virus transmission. [SLC 2065] [PMT 2075]
a) Mouse b) Printer c) Microphone d) Pen drive/Flash drive
10. Computer virus can spread from one computer to another through_
i. Infected portable disk ii. The Internet iii. Pirated software iv. All of the above.
11. A program or set of programs designed to prevent, search for, detect, and remove software viruses, and other
malicious software like worms, Trojans, adware and more.
i)Shareware ii)Freeware iii)Antivirus
12. Which is not a computer virus ? [SEE 2075]
(i) kaspersky (ii) message carrying virus (iii) Boot sector virus (iv) Program virus
13. Which of the following is not anti-virus
i.AVG ii.NAV iii. Kaspersky iv. I Love you
14. Which of the following is an anti-virus program? [SLC 2068 S]
i) NAV ii) Windows iii) Photoshop iv) All of the above
15. An example of antivirus software is
i. NAV ii. McAfee iii. CPAV iv. All
16. Which is antivirus software?
i. Scan ii. Defrag iii. Kaspersky iv. Power point
17. A program that is used to detect and remove virus. [SEE 2075 U]
i) C- Brain ii) Worm iii) Trojan Horse iv) Kaspersky
18. Norton antivirus, when loaded onto a computer system , checks the following areas for viruses
a) boot record b) programs at the time you use them c) both
19. ________ Virus are often transmitted by a floppy disk left in the floppy disk drive.
a) Boot-sector Trojan horse Script logic bomb
20. Which computer virus damages the master boot record? [SLC 2068]
i) Macro virus ii) File virus iii) New folder virus iv) Boot sector virus
21. Which virus infects boot sector files? [SLC 2069]
i) Macro virus ii) Multipartite virus iii) Boot sector virus iv) Program virus
22. Boot sector virus infects [SLC 2066]
i. System files ii. Master boot record iii. Application software iv. Document file
23. Disk Killer, stoned and Michelangelo are examples of ________________
i) Boot sector virus ii) File infecting virus
iii) Polymorphic virus iv) All of the above
24. A virus that infects the part of the computer called a system sector.
i. Boot sector virus ii. File infecting Virus iii. Polymorphic virus iv. None of the above
25. Which of the following virus infects the various parts of operating system?
i. boot sector ii. Worm iii. Macro iv. system infector
26. A type of virus that infects executable files having .exe, .com, .ovl, .drv, .sys, or .dil.
i) Boot sector virus ii) File infecting iii) Script virus iv) Macro virus
27. __________ Virus can infect both programs and boot sectors.
a) Stealth virus b) File infectors c) Multipartite virus d) Polymorphic virus
28. Multipartite viruses have combination features of
i. Boot sector & stealth virus ii. Boot sector ¯o virus
iii. Boot sector & program virus iv. None
29. Viruses attach themselves to documents such as Word and Excel.
a) Macro virus b) File infectors c) Polymorphic virus
30. __________ is a self-encrypted virus designed to avoid detection by a scanner.
i. Polymorphic virus ii. Macro virus iii. Script virus iv. None of the above
https://seeqbasicomputer.blogspot.com/ 34 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Fill in the Blanks [20]
1. The first person who introduced the concept of replicating program was John von nevmann.
2. Computer virus Is a program that spreads by first infecting files or the system areas of a computer or network
router’s hard drive and then making copies of itself.
3. Computer virus is a program that can copy itself and infect a computer without the permission or knowledge of
the user.
4. Computer virus is a program containing code that can generate multiple copies of itself .
5. The capability of generating the copies of itself is called replication.
6. Antivirus software is a class of program that searches your hard drive and floppy disks for any known or potential viruses.
7. Antivirus are used to detect and remove computer virus from infected file or memory. [SLC 2064]
8. Message carrying viruses usually do not destruct the computer files/programs but display interesting information
to entertain the users.
9. Firewall are software programs or hardware devices designed to keep computers safe from hackers.
10. A MBR is an area of the computer hard drive or a floppy disk that is executed when the computer is started.
11. Boot sector virus infects or substitutes its own code for either the DOS boot sector or the master boot
record(MBR)
12. File infector viruses infect executable program files having an extension .exe,.com,or.dll.
13. File infector virus affect executable file.
14. A macro virus is a type of computer virus that infects the word processing or spread sheet document or template.
15. A malicious program that pretends to be something useful program is known as trojan horse.
16. A program that is not a virus but behave like virus and can replicate is known as worm.
17. Multipartite viruses can infect both the application programs and the boot sector of a disk.
18. Polymorphic code is a code that mutates while keeping the original algorithm intact.
19. A polymorphic virus is a complicated computer virus that affects data types and functions.
20. Polymorphic viruses are very difficult to identify and detect by anti-virus.
True / False [30]
1. A computer virus can cause actual damage or destruction to the hardware components of a computer system. True
2. Virus spreads across disks and networks by making copies of it. True
3. Computer viruses used to be a developed unknowingly while developing computer program. False
4. Viruses are easily identified as other programs. False
5. Viruses mostly spread through computer network. False
6. Viruses change the size of file and memory. True
7. Computer virus deletes unnecessary data, information and programs of a computer. False
8. Computer virus is visible like other files and programs. False
9. Computer viruses are created to stop the software piracy. True
10. Computer viruses hide themselves in host files. True
11. Computer virus decreases the space in the main memory and increase the size of the executable files. True
12. A computer virus needs another program in order to be able to be activated and infect other computer files. False
13. Each computer virus contains instructions to initiate a unique, problematic event on the infected computer. True
14. Computer viruses cannot delete files and format a user’s hard disk. False
15. Pirated software copies viruses, to the computer. True
16. Do not install pirated software, especially computer games. True
17. Viruses can easily hide within a system by attaching themselves to other files or program because they are small
in size. True
18. System infectors usually enter to the system as a device driver and get loaded into memory. [SLC 2064]. True
19. Script viruses attach themselves to any executable file, usually .COM, .BIN, EXE etc. False
20. A macro virus infects both the application program and the boot sector of disk. True
21. Macro viruses infect files created in Microsoft application software like MS-Word, MS-Excel, etc. True
22. A virus that can change its appearance with every infection is called macro virus. False
23. Stealth virus is a file virus that uses special technique to hide its presence from user and virus scanners. True
24. Stealth virus is a computer virus that uses various mechanisms to avoid detection by antivirus software. True
25. A files infecting virus activated only when you turn or a restart your computer. False
https://seeqbasicomputer.blogspot.com/ 35 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
26. A macro virus is a computer virus that replaces a macro, which is what enables a program to work and instigates a
designated group of action and commands. True
27. An anti-virus program having old virus definition file can effectively detect the latest virus. True
28. Antivirus software must perform algorithms scanning to detect script virus. True
29. Multi-partite virus can infect both the boot sector of the disk and executable file. True
30. Boot sector virus infects the program files. [SEE 2075 S2] False
https://seeqbasicomputer.blogspot.com/ 36 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Multimedia
Questions and Answers [15]
1. Multimedia [SLC 2064] [SLC 2065 S] [SEE 2067 S] [SLC 2070 S] [SEE 2073] [SEE 2073 U] [SEE 2075]
Multimedia is the integration of multiple forms of media, which presents information in more interesting and
understandable way.
Multimedia technology is becoming popular because it shares the ideas, views and thoughts of people in an
interactive, effective and understandable way.
The five types of media used in multimedia technology are:
i) Text ii) Audio iii) Video iv) Graphics v) Animation
2. Application areas of multimedia technology [SLC 2064] [SLC 2065 S] [SEE 2067 S] [SLC 2070 S]
[SEE 2073 U]
The application areas of multimedia technology are Communication, Entertainment, Medicine, Education, Video
games, Advertisement, Presentation, Films, Public accessing, Learning foreign language, etc.
3. Advantages of multimedia technology [SLC 2067] [SLC 2069 S] [SEE 2072] [PMT 2075K]
a) Multimedia enhances standard education techniques and makes learning process easier.
b) It makes easy to share views, ideas and thoughts among various people.
c) The use of multimedia can enhance every area in a presentation.
d) It makes presentation of related subject matter attractive.
e) Information combined with multimedia will be easy to understand and convincing.
7. Animation
Animation is a simulation of movement created by displaying a series of pictures or frame.
The moving graphic images is called animation.
For example: Cartoons
8. Video
Video presents the moving images of the real events.
For example: Movies.
9. Virtual reality
Virtual reality is an artificial environment created by computer hardware and software and presented to the user in
such a way that it appears real.
https://seeqbasicomputer.blogspot.com/ 37 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
10. Multimedia computer system [SQE 2074K]
A multimedia computer is a computer equipped with special hardware and software that makes multimedia
possible. The components of multimedia computer are:
i) Faster CPU ii) Larger storage device iii) Large main memory
iv) High resolution monitor v) Sound card and speaker vi) Keyboard and pointing device
11. Multimedia in education [ [SEE 2066 S] SLC 2068] [SLC 2068 S] [MM 2076]
The role of multimedia in education is that it makes teaching / learning easier in classroom as well as it makes
presentation of related subject matter attractive.
Edutainment
A form of education which is designed to be entertaining in order to keep people interested and engaged is called
edutainment.
Hyper media
An extension of hypertext that supports linking graphics, sound and video elements in addition to text elements is
called hypermedia.
https://seeqbasicomputer.blogspot.com/ 38 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
8. Which of the following is the component of multimedia? [SLC 2069 S]
i) Network ii) Microphone iii) Power cable iv) Printer
9. Select the common components of the multimedia computer system.
i. Floppy Floppy drive CD-ROM None
10. Which is not related to multimedia? [SLC 2069]
i) Printer ii) Sound card iii) Microphone iv) CD-ROM
11. Which of the following is an audio output device? [SLC 2070]
i) Microphone ii) Speaker iii) Monitor iv) Printer
12. Which of the following is an audio input device? [SLC 2071]
i. Printer ii. Microphone iii. Head phone iv. Speaker
13. Which of these software is used for photo editing? [SLC 2074]
(i) Ms-Excel (ii) Photoshop (iii) Power-Point (iv) Ms-Word
14. Which one is the software used in multimedia?
CD-ROM Sound Card Sound Forge MS-Word
15. Software used in multimedia system. [SEE 2075 U]
a) Animator b) Flash Player c) Power Point d) All of them
16. Which is the multimedia software ? [MM 2076]
i) Photoshop ii) MS Power point iii) VLC Player iv) All of them
17. The software associated with the multimedia technology is .
i. Macromedia Flash ii. Microsoft Word. iii. Adobe In design iv. None of the above
18. Software associated with the multimedia technology is
Windows XP Macromedia Flash QBASIC None
19. Which of the following is software used in multimedia technology.
i. Office XP ii. Adobe Photoshop iii. Basic iv. None of the above
20. Which of the following is not multimedia software?
i. Windows media player ii. Windows XP iii. Adobe illustrator iv. Macromedia flash
21. Which of the following is multimedia application?
i. Education ii. Entertainment iii. virtual reality iv. All of above
22. Multimedia technology is very effective in
i. Market Classroom War None
23. Multimedia technology is used in ……… [SLC 2066]
i) Education ii) Business iii) Health care iv) All of the above
24. An artificial reality that projects the user into a 3D space generated by the computer.
Virtual Reality Virtual Computer All of the above None of the above
25. An upcoming technology that makes users feel in Virtual Environment(VE) by using computer hardware and
software.
i)Virtual space ii)Virtual computer iii)Virtual reality iv)None of above
26. _____ deals with the recording and display sequence of images at a reasonable speed to create an impression of
movement.
Graphics Video Animation Text
27. Graphics that contain movement often referred to as .
i. Graphics ii. Video iii. Animation iv. Text
28. _______ provides a visual impact.
Image Graphics Video None of them
29. The process of displaying still images in a rapid sequence to create the illusion of movement.
i)Text ii)Graphics iii)Video iv)Animation
30. An extension to hypertext supports linking graphics, sound and video elements in addition to text elements.
Interactive media Hypermedia All of the above None of the above
https://seeqbasicomputer.blogspot.com/ 39 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
https://seeqbasicomputer.blogspot.com/ 41 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Cyber Law And Ethics
4. Cyber space
A virtual space created by computer network, internet and telecommunication is called cyber space.
https://seeqbasicomputer.blogspot.com/ 42 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
9. Digital signature
Digital signature is a security mechanism system used on the internet for data and information transaction by
attaching a code at the end of the electronic message that attests the authenticity of sent message. The importance
of digital signature is that it provides legal framework to facilitate and safeguard electronic transaction in the
electronic media.
10. Encryption
The process of encoding (scrambling) information in such a way that it is unreadable to all is encryption.
Decryption
The process of restoring encrypted data to its original form is decryption.
11. Computer ethics [SEE 2075 U] [SLC 2065] [SLC 2069] [U1]
Computer ethics refers to follow the rules and regulation of computer technology and not to harm other computer
users knowingly or unknowingly.
12. Premeditated, usually politically-motivated violence committed against civilians through the use of, or with the
help of, computer technology
i) Cyber stalking ii) Cyber laundering iii) Cyber theft iv) Cyber terrorism
13. The act of attempting to acquire sensitive information like usernames, passwords and credit card details by
disguising as a trust worthy source.
i) Hacking ii) Phishing iii) Computer Virus iv) Cyber stalking
14. Electronic transfer of illegally-obtained monies with the goal of hiding its source and possibly its destination.
i)Cyber stalking ii) Cyber laundering iii) Cyber theft iv) Cyber terrorism
15. The method of making the data or message unreadable by unauthorized people.
Digital signature Decryption Encryption All of them
16. Which of the following is included in cyber law?
i. Trademark right ii. Copyright iii. Data privacy iv. All of the above
17. The law which includes literature and art, films, computer programs, invention, designed used by traders for their
goods or services is called:
iii. Data Privacy Law Intellectual Property Law
iv. Telecommunication Law Cyber crime Law
18. The Process of ensuring the preservation, integrity and reliability of data is Known as:
v. Intellectual Property Law Data Protection and Privacy law
vi. Cyber Law Telecommunication Law
19. The law that provides a legal framework to facilitate and safeguard electronic transaction in the electronic
medium.
i. Digital signature law ii. Intellectual property law ii. Telecommunication law
20. A federal law enacted in 1970 to ensure confidentiality of consumer credit information held by lenders and credit
reporting agencies.
i. Fair credit reporting act ii.Federal privacy act iii.Copyright act
https://seeqbasicomputer.blogspot.com/ 44 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
6. Cyber crime may include thefts or actions in electric form that causes damages or difficulty to other computer
users.
7. Cyber crime is a criminal activity done using computers and the Internet.
8. Cyber Crime refers to illegal activities involved in any computer.
9. The activity of breaking into a computer system to gain an unauthorized access is known as .
hacking.
10. The use of communication technology, mainly the Internet to torture other individuals is known as cyber stalking.
11. Computer ethics is the set of moral principles that regulate the use of computers.
12. Cyber space does not only include the internet and computers, but it present where two or more cables or wires
etc meet.
13. Cyberspace has become synonyms with the internet.
14. A digital signature is an electronic signature that can be used to authenticate the identity of the sender of a
message or the signer of the document, and possibly to ensure that the original content of the message or
document that has been sent is unchanged.
15. Digital Signature is a security Mechanism system in the cyberspace for digital data processing and transaction.
16. Intellectual property law is a term referring legal property rights of someone over his creations of the mind ,
both artistic and commercial.
17. The law which is enacted to ensure the preservation, integrity and reliability of data is called data protection and
privacy law.
18. Fair credit reporting act is a federal law enacted in 1970 to insure confidentiality of consumer credit information
held by lenders and credit reporting agencies.
19. Video privacy protection act limits the disclosure of personally identifiable information regarding video rentals.
20. US introduced fair credit reporting act in 1970 A.D.
https://seeqbasicomputer.blogspot.com/ 46 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Ms-Access
4. Non-Computerized Database
It is limited by physical storage available.
It can take a while to manually search through all of the records.
Difficult to sort data on more than one criteria.
The only security would be locking up the records.
5. Data [SEE 2073] [SLC 2064] [SLC 2070] [[SLC 2065 S] [SLC 2069 S]
Data can be numbers, letters or symbols representing facts and figures which may or may not give any sense.
E.g.: Ram, student, 20, etc.
7. DBMS (Database Management System) [SEE 2075 U] [SEE 2074 U] [SLC 2066] [SLC 2067] [SLC 2067 S]
[SLC 2069 S] [SQC 2075K]
DBMS is a software which helps to extract, view and manipulate data in an organized way.
In DBMS, data can be accessed, managed and updated easily.
E.g.: MS-Access, Oracle, Fox pro, Dbase etc.
https://seeqbasicomputer.blogspot.com/ 47 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
10. MS-Access
MS-Access is a relational database management system developed by Microsoft Corporation which is used to
store and manipulates large volume of data in the form of table.
15. Form [SEE 2073 U] [SLC 2064] [SLC 2066] [SLC 2068] [SLC 2065 S] [SLC 2069 S] [SQE 2075K]
[SQE 2074]
Form is an object of Ms-Access which provides graphical interface to enter data into the tables or multiple 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 with the 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.
16. Importance / Function / Advantages of form [SEE 2075] [SLC 2064] [SLC 2066] [SLC 2065 S]
[SLC 2070 S] [SQE 2074]
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.
17. Query [SEE 2075 U] [SEE 2075 S2] [SLC 2072] [SLC 2065] [SLC 2069] [SEE 2066 S] [SLC 2068 S]
[MM 2076] [PMT 2075K]
Query is an object of Ms-Access which extracts and arranges information from a table in a manner that is
specified.
The different types of query are:
i) Select query
ii) Action query
In action query, we have update query, append query, delete query and make-table query.
https://seeqbasicomputer.blogspot.com/ 48 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
19. Purposes of query in MS-Access [PMT 2075K]
a) To view records including some fields or all the fields of a table or multiple linked tables.
b) To perform mathematical calculation of a data.
c) To sort the records on the basis of one or more key fields.
d) To perform mass update, delete or append new records to a table.
24. Report [SEE 2074 U] [SEE 2071 S] [SLC 2070] [SLC 2067 S]
Report is an object of Ms-Access which displays the output in an effective way to present the data in a printed
format.
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 work with 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
28. Data type [SEE 2075 S2] [SEE 2074] [SEE 2073] [SLC 2072] [SLC 2064] [SLC 2066] [SLC 2070]
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
https://seeqbasicomputer.blogspot.com/ 49 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
29. While designing table structure which data types are suitable to store information about teacher’s name,
address, salary and date of birth. [SLC 2065] [SLC 2068 S]
Teacher’s name - Text
Address – Text
Salary – Currency
Date of birth – Date/Time
30. Identify a record, field and value from the following table structure. [SQE 2074]
Roll Name Marks
1 Kopila 87
2 Rabin Rana 56
Ans: Record = 1 Kopila 87, 2 Prabin Rana 56
Field = Roll, Name, Marks
Value = 87, 56
32. Text
It is used for storing text or combination of text and numbers. It can store up to 255 characters.
33. Memo
It is used for storing lengthy text and numbers. It can store up to 65,535 characters.
36. 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.
40. Format
The use of ‘Format’ field property is to display data in a different format.
https://seeqbasicomputer.blogspot.com/ 50 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
43. Indexing
Indexing is one of the important properties of database that speed up searching and storing of records using on the
field.
44. Relationship
Relationship is an association among several entities (table). Its types are:
i)One to one relationship
ii)One to many relationship
iii)Many to many relationship
52. Importance of Primary Key [SEE 2073] [SLC 2069 S] [MM 2076]
a) It does not allow duplicate data.
b) It does not allow null value
53. Composite key
The group of primary key that consists of two or more attributes is called composite key.
54. Foreign Key
Foreign key is a unique field or combination of fields in linked table whose value matches with a primary key in
another table.
55. Data Redundancy [SEE 2074]
Data redundancy means repetition of same piece of data in a database in more than one location.. Data redundancy
can be controlled in MS-Access by normalization of database.
https://seeqbasicomputer.blogspot.com/ 51 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
MCQ (Multiple Choice Questions) [80]
1. Database is a
i.tool of editing documents ii. way to automate common tasks
iii. collection of related information
2. A (n) ____________________ is an organized collection of the related information.
Object database Property document
3. Which is the database?
Data of SLC Exam Oracle MS-Access Excel
4. A database is the collection of __________[PMT 2075]
i. Hardware ii. Software iii. Record iv. None of these
5. Which is not the database?
i. Phone diary ii. Mark ledger iii. Attendance Register iv. Report Card
6. Which is the example of Relational Database Management System?
i.Oracle ii.FoxBASE iii.Sybase iv.FoxPro
7. __________ is a Database Management System.
DBase MSAV EXCEL All of above
8. Ms-Access is a ............ software. [SEE 2075 S2]
(i) Word processing (ii) DBMS (iii) Spreadsheet (iv) Web
9. MS-Access is a
DBMS RDBMS Database Metabase
10. MS-Access is used to create _____________.
Database DBMS Record Table
11. ___________ is not DBMS.
Oracle dBase FoxPro Paint
12. Which is an example of database? [SLC 2064]
DBase MS-Access Telephone Directory All
13. …………… is the DBMS. [SLC 2065]
i) Fox-Pro ii) MS-Excel iii) Lotus-123 iv) All of the above
14. Which of the following is database application? [SLC 2070]
i) MS-Word ii) MS-Access iii) MS-Excel iv) QBASIC
15. Which of the following is not a database application? [SLC 2069]
i) Oracle ii) Foxpro iii) MS-Access iv) MS-Excel
16. MS-Access is a ------------ software.
i. Utility ii. Application iii. System iv. None of the above.
17. Which is DBMS?
i. Database ii. Metabase iii. dBase iv. MS-Excel.
18. A Database Management System can be used to .
i. retrieve information ii. search information iii. sort information iv. all of the above
19. ___________________ is a set of rules used by Access to ensure that the relationships between tables are valid
and that the related data is not accidentally changed or deleted.
Relationship Referential integrity Query Forms
20. What is extension of access database? (MS-Access 2003 version) [SLC 2066]
DBF MDB MBD DBM
21. _____ is the table design creating option to create custom table design.
Datasheet Design view Wizard Link Table
22. _____ is a data type used for lengthy text and numbers
Text Long Text OLE Object Memo
23. A field name can be up to _____ characters long. [MM 2076]
40 46 64 2048
24. Data type that requires 8 bytes of storage.
Yes/No Currency Long Integer All of them
25. Memory space consumed by a currency data type maximally is …………[SLC 2069]
i) 2 bytes ii) 4 bytes iii) 8 bytes iv) 1 GB
https://seeqbasicomputer.blogspot.com/ 52 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
26. The data type appropriate to store salary is: [SLC 2067]
i)Memo ii)Currency iii)Text iv) Auto number
27. The name of caption can be declared up to _____ characters.
1024 2024 2048 2005
28. Memory space used by a auto number data type is _____
1 Byte 2 Bytes 4 Bytes 8 Bytes
29. What is the default size of Access?
(i) 10 (ii) 20 (iii) 30 (iv) 50
30. Date/Time occupies ………. bytes of memory. [SLC 2066] [SLC 2067] [MM 2076] [PMT 2075]
i) 4 ii) 2 iii) 8 iv) 16
31. The maximum size of text field in MS-Access is …………. [SLC 2068 S] [SLC 2070]
i) 50 ii) 10 iii) 6400 iv) 255
32. Format symbol that converts all characters to uppercase.
@ & < >
33. …………… is not the data type of MS-Access. [SLC 2065] [SLC 2068]
i) Number ii) Text iii) Memo iv) Form
34. The logical field data type of MS-Access is______________ [SLC 2064]
i. Yes/No ii. True/False iii. On/Off iv. All of the above.
35. The field size of logical field data type is __________ in MS-Access.
i. 1 bit ii. 1 byte iii. 2 bytes iv. 2 bits
36. Which data type consumes the least storage space? [SEE 2074]
(i) Text (ii) Yes/No (iii) OLE object (iv) Memo
37. Which of the following data type is appropriate to store gender of person in terms M or F?
i. Memo ii. Currency iii. Yes no iv. Auto number
38. The default data type of MS-Access is: [SLC 2068 S] [SLC 2069] [SEE 2074] [SQE 2074K]
i) Number ii)Text iii) Memo iv) Auto number
39. The default field size of “AutoNumber” data type is [SEE 2075 S2] .
i. Byte ii. Integer iii. Long Integer iv. Long Integer
40. Which is the subtypes for the number data type?
Hyperlink Bit Index Integer
41. Which is the subtype of number data type?
i. Integer ii. Byte iii. Single iv. All of the above.
42. Number field is used for storing only _______________.
Number Text and Number Number and Time Number and Year
43. The datatype which is used for only integer value.
i.text ii.currency iii.number iv.OLE
44. Which is not MS-Access object? [SQE 2074K]
a) Form b) Query c) Caption d) Table
45. Which of the following is not a Microsoft Access database object? [PMT 2075]
i. Tables ii. Queries iii. Forms iv. Sorting
46. Which of them is not a data type?
Memo Yes/No Time/Date Caption
47. Which of the following is not a data type?
i. Picture ii.date/time iii.text iv.number
48. Which of the following is not the data type used in MS-Access?
i. Date/Time ii. Counter iii. Hyperlink iv. Caption
49. Which of the following is not a data type in Microsoft Access?
i. Text ii. Currency iii. Hypertext iv. Date/Time
50. What field type is used to store picture in a table?
i.memo ii.OLE iii.hyperlink iv.None
51. Which is suitable data type to store video? [SLC 2070] [SEE 2073]
i) Text ii) Number iii) Hyperlink iv) OLE object
https://seeqbasicomputer.blogspot.com/ 53 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
52. The data type appropriate to store address is .
i. Memo ii. Currency iii. Text iv. Auto number
53. What kind of data is kept in memo field?
(i) Hyperlink (ii) Software (iii) Data (iv) Pictures
54. What kind of data are kept in memo field?
i.Name of Student ii.Students phone number iii.Students Bio data iv.Students picture
55. Which specifies the expression that checks the invalid data? [MM 2076]
Validation Rule Validation Text Input Mask Required
56. _____ is not a field property of MS-Access.
Caption Index Color Format
57. …………… defines a standard pattern for the appearance of all data entered in the field
i.format ii.input mask iii.default value
58. A field property that limits the data to be entered in a field is___________
i. Validation Rule ii. Format iii. Input Mask iv. Indexed
59. The maximum number of characters that can be stored in a field is determined by_
i. Field Type ii. Field Size iii. Field Length iv. Field width
60. Field size, format, input mask, caption and default values are: [SQE 2074K]
Key elements field properties Navigating modes data types
61. The primary key contains _____ value.
Null No Null Number Auto number
62. The _________________ key uniquely identifies each record. [SLC 2066]
Primary database Object premier
63. Primary key does not accept …………… [SLC 2064] [SLC 2065] [SLC 2068] [SEE 2074] [SQE 2074K]
i) Text ii) Number iii) Null value iv) None of the above
64. In MS-Access data are stored in ……………… [SLC 2068]
i) Form ii) Query iii) Table iv) All of the above
65. Form is designed for
i. filters data ii. Sort data iii. Print data iv. Modify data
66. Which component of MS-Access is used to enter data? [SLC 2065]
i. Query ii. Forms iii. Report iv. Both (i) and (ii)
67. Which component of MS-ACCESS does not allow entering data? [SLC 2064]
i. Table ii. Query iii. Form iv. None of them
68. Query is used to
i. retrieves data from database ii. Create table in database iii. Print database iv. All
69. …………….. query changes value in main table. [SLC 2068 S]
i) Select ii) Update iii) Both (i) &(ii) iv) None of the above
70. Which is not a type of query? [SLC 2067] [SEE 2073]
i) Search ii) Select iii) Update iv)All of the above
71. Report can be generated by using data from …………[SLC 2068 S]
i) Table ii) Query iii) Forms iv) Both (i) &(ii)
72. ……………….. object of access is used to print formatted data. [SLC 2068] [SEE 2073]
i) Query ii) Form iii) Report iv) Table
73. The object of MS-Access that is used to generate hard copy of records. [SLC 2066]
i) Query ii) Table iii) Form iv) Report
74. __________allows MS-Access to query and sort record faster. [SEE 2075 S2]
i. Sorting ii. Editing iii. Filtering iv. Indexing
75. A collection of records for a single subject, such as all of the customer records. [PMT 2075]
i. Field ii. Record iii. Table iv. Data
76. Collecting multiple related fields is called: [SLC 2067]
i) Records ii)Table iii) Forms iv)Query
https://seeqbasicomputer.blogspot.com/ 54 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
77. Record of the table is also knows as ...... [SEE 2075 S2]
(i) Tuple (ii) Field (iii) Text (iv) All
78. A field is also known as [MM 2076]
i.records ii. column iii.Database iv.entity
79. Row is also called …………[SLC 2069] [SEE 2074]
i) Record ii) Field iii) Database iv) Table
80. The columns in database tables are called: [SLC 2070] [SEE 2073]
i) Record ii) Field iii) Report iv) Memo
https://seeqbasicomputer.blogspot.com/ 56 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
59. Index decreases the speed of the query and sort operations. [SLC 2065 S] [SLC 2072] False
60. Indexing is the process of arranging the records in ascending or descending order. [SEE 2075] False
61. Arranging all the records in a table either ascending or descending order is known as filtering. [SEE 2073 U] False
62. Indexed field property speeds up searching and sorting of records based on a field. True
63. A row in a table is known as record. [SLC 2069 S]True
64. Collecting multiple related fields is called report.[ SQE 2075K] [False]
65. A row in a table is called field and it contains a specific piece of informarion within a record. False
66. Column is also called field [SEE 2075 U]. True
67. Lookup Wizard is a tool that automates many database tasks. True
68. Money is a data type used in MS-Access. [SEE 2073 U] False
69. Table is not the data type of MS-Access. [SLC 2071 S] True
70. Default field size of text type of data is 65535 characters. False
71. Date/Time type of data requires 8 bytes of memory. True
72. The size of currency data type is 10 Bytes. [SEE 2075] False
73. FORMAT property allows us to delete data from database. False
74. Subtype of number data type is integer. True
75. Deleting a field does not delete data in the field. False
76. Validation rule is used to specify whether a value is required in a field. True
77. Validation rule specifies the expression that checks the invalid data. True[ SQE 2075K]
78. Validation rule will limit data entry. [SEE 2075] True
79. You cannot insert any field after entering data in the table. False
80. Logical field has the size 2. False
81. The information can be used as data for the further processing. True
82. The Auto Number data type generates random number automatically whenever a new record is added to a table. False
83. We cannot change data type of a field. False
84. Memo field is used to store long information beyond of the text. True
85. Yes/No Logical field stores one bit of data. True
86. OLE is the data type of MS Access. [SQE 2075K] True
87. Logical value can also be stored in database. True
88. A field can’t be declared with data type. True
89. Hyperlink field type in used to store photographs. False
90. Data validation enables you to limit the values that can be accepted into a field. True
91. A default value is one that is not displayed automatically for the field into a field. False
92. The data filter selects the required records and displays the result. True
93. Memo data type cannot be indexed. [SLC 2066 S] True
94. The default size of text data type is 50. [SLC 2066 S] True
95. Text is and object of MS-Access. [SEE 2075 U] False
96. Default text field size is of 255 characters. [SLC 2069 S] False
97. Data like sound and pictures are held by memo data type. [SLC 2069 S] False
98. Auto number data type is used to store data supplied by us. [SLC 2070 S] False
99. Auto Number Data consumed 2 bytes of memory space. [SEE 2075 U] False
100. Maximum data size of an auto number is 4 bytes. [SEE 2073 U] True
101. Formatted document is also called report. [SLC 2070 S] True
102. Graphics can also be stored in MS-Access database. [SLC 2071] [SEE 2074 U]True
103. Maximum field size of memo field is 256 characters. [SLC 2071] False
https://seeqbasicomputer.blogspot.com/ 57 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Match the following – MS Access [30]
1. [SLC 2065 S] 2. [SLC 2066]
a) MS-ACCESS (d) analyze and present data in a a) Default value (c) 255 Characters
printed format
b) Data update (b) Query b) Fox Pro (d) Column Name
c) Field (c) a piece of information related to c) Text (b) DBMS
someone or something
d) Report (a) Database management software d) Field (a)Field Properties
(-) collection of related fields (-) Search fast
c) Record (b) Tool to retrieve data from one or c) Validation (-) Error messages
more than one tables Rule
d) Form (a) Data base management software d) Hyper (b) Final output
link
(c) Collection of related fields (a) Search fast
17. 18.
a) Data redundancy (b)Error message a. Indexing data (a)Searching fast
b) Validation Text (c)Pattern of data in a field b. Long text (d)Caption
c) Input Mask (d)Limits the value c. FoxPro (b)Memo field
d) Validation Rule (a)Data duplication d. Label for a field (c)DBMS
19. 20.
a) Text (d)2048 characters a. Data type (b)Field property
b) Currency (a)up to 255 Characters b. Format (d)Relationship
c) Memo (b)8 Bytes c. Form (a)Memo
d) Hyperlink (c)0-65535 Characters d. One-to-one (c)Database Object
21. 22.
a) Data Integrity (c)No. of character can be a) Index (c)Tuple
entered
b) Automatic (d)Contains distinct value b) Data (d)software
redundancy
c) Field size (a)Validation Rule c) Record (a)easy to search
23. 24.
a) Sort (d) mass change e) Number (d)50
https://seeqbasicomputer.blogspot.com/ 63 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Match the Following – Fundamentals [50]
1. [SLC 2064] 2.
a) Radio Wave (d) Device to connect network a) NCSA Mosaic (d)Internet Protocol
having different technology
b) Cyber ethics (c) power protection device b) ARPA (e)Online shopping
c) Spike guard (-) internet c) WWW (b)Funded by US DOD
d) Gateway (b) professionally guided principles d) TCP/IP (c)Dr. Berners-Lee
(a) Wireless Media e) E-commerce (a)First web browser
https://seeqbasicomputer.blogspot.com/ 64 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
15. [SLC 2070 S] 16. [SLC 2071 S]
a) TCP/IP (c)Multimedia a) Node a) Workstation
b) Back up (d)Web address b) Server d) HTTP
c) Sound card (b)Software security c) Coaxial cable c) Communication media
d) URL (a)Protocol d) Protocol b) Main computer
17. [SEE 2072] 18. [SEE 2073]
a) Microwave (c) Power protection device a) Malicious software (c) UPS
b) UTP (d) Protocol b) Primary storage device (a) virus
c) UPS (a) Unguided media c) Power protection device (d) copyright
d) SMTP (-) Internet d) Intellectual property law (b) RAM
(b) Guided media e) Malicious software (c) UPS
19. [SEE 2074] 20. [SEE 2075 Upgrade]
a) RJ 45 connector (b) Duplicate copy a) Microwave (d) Protocol
b) Back up (c) Multimedia b) UTP (c) Power protecting device
c) Microphone (a) Twisted pair cable c) UPS (a) Unguided media
d) Hub/switch (-) Ring Topology d) SMTP (-) Internet
(d) Star Topology (b) Guided media
21. [SEE 2075] 22. [U1]
a) Hub (c) Communication media a) LAN c) Software security
b) TCP/IP (a) Network connecting device b) Client/server d) Hardware security
c) UTP (d) Windows NT c) Back up a) Network type
d) NOS (b) Protocol d) Fire control b) Network architecture
e) Computer Virus
34.
a) TCP/IP (a)Addressing data, converting them into packets and Routing
b) FTP (d)Transfer mail and attachment on the network
c) POP (b)Transfer files between two computers
d) SMTP (c)Fetching mails from the mail server to a user’s computer
35.
a) E-mail (e)A private network within an organization
b) World Wide Web (c)The opening or main page of a website
c) Home Page (d)The buying and selling of goods and services on internet
d) Electronic commerce (b) The leading information – exchange service of the internet
e) Intranet (a)The exchange of computer-stored messages telecommunication
36. 37.
a) Usenet (b)Instant Chatting a) Internet (c)Service of internet
b) MSN (c)Remote Login b) HTTP (d)Internet Service provider
38. 39.
a) password (c)Duplicate copy of data a) Antivirus (d)Software that prevent gaining
access
b) Encryption (a)Secret word or phrase b) Scandisk (c)Arranging the scattered data
c) Backup (d)Authentication c) Defragmentation (b)Checking for disk error
d) Access Control (-)Rearrangement of fragmented d) Firewall (a)Software to remove malicious
file Programs
(b)Scrambled and unreadable form
of information
40. 41.
a) Hardware (-)Rewriting the files to contiguous a) Real player (b)Upgrade the PC
security sector
b) Software (c) Scattering the disk file over b) MUK (d)Headsets and data gloves
different locations
c) Fragmentation (d)Provide access to the computer c) Animation (a)Software to view multimedia
system content
d) Password (b)Antivirus d) Virtual reality (c)Cartoon on television
(a)Insurance policy (-)Multimedia component
https://seeqbasicomputer.blogspot.com/ 66 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
42. 43.
a) Backup (d)Software that destroys a) Hard Lock Key (c)Hardware Security
data
b) Password (c)Utility software b) Spike guard (a)Software security
c) Scan Disk (a)Copy of data c) Insurance (b)Power protection device
d) Computer virus (b)Allows the user to access d) Burlar alarm (-)Computer Security
system
(-)System Software (d)Prevents unauthorized
entrance
44. 45.
a) Boot sector virus (-) McAFee a) Boot virus (c)Cascade
b) File infecting virus (c) W97M.Melissa b) Parasitic virus (a)Disk Killer
46. 47.
a) Edutainment (c) Components of a) Audio (b)Monitor
multimedia
b) Virtual Reality (d) Multimedia software b) Video (a)Speaker
c) Graphics (a) Multimedia in education c) Sound (d)Still frame pictures
Card
d) Adobe Photoshop (b) Simulated software d) Graphics (c)Recording and playing
sound
(-)Multimedia card
48.
a) Cyber stalking (c)Electronic transfer of illegally-obtained monies with the go with the goal of hiding its source and
possibly its destination
b) Phishing (e)The activity of breaking into a computer system to gain to unauthorized access
c) Cyber laundering (a)The use of communication technology, mainly the internet, to torture other individuals
d) Cyber Contraband (b)The act of attempting to acquire sensitive information like usernames, passwords and credit card
details by distinguishing as a trustworthy source
e) Hacking (d)Transferring illegal items through the internet (such as encryption technology) that is banned in some
locations.
49.
a) Hacking (c)The use of communication technology, mainly the Internet, to torture other individual.
b) Phishing (-)The computer program that can replicate themselves and harm the computer system on a network
(d)within the knowledge of the system users.
c) Cyber stalking (a)The activity of breaking into a computer system to gain an unauthorized access.
d) Computer viruses (e)This is one of the most serious frauds as it involved stealing money and obtaining other benefits
through the use of false identity.
e) Identity Theft (b)The act of attempting to acquire sensitive information like usernames, passwords, and credit card
details disguising as a trustworthy source.
50.
a) Digital Signature (b)Cyber crime a) Fair Credit reporting Act (d)1988
b) Forgery (a)Electronic security b) Copyright (g)Encryption and
system decryption
c) Encryptions (d)Cyber law c) Cyber law of Nepal (e)1992
d) Copy right (c)Locking message d) Video Privacy Protection (a)1970
Act
e) Copyright Act (c)2004
f) Federal Privacy Act (f)1974
g) Digital Signature (b)Intellectual property
https://seeqbasicomputer.blogspot.com/ 67 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Modular Programming
Questions and Answers [25]
1. Modular programming [SEE 2075 U] [SLC 2066] [SEE 2065 S] [MM 2076] [PMT 2075K]
Modular programming is a technique used to divide program into many small, manageable, logical and functional
modules or blocks.
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 [SLC 2072] [SLC 2071] [SLC 2064] [SLC 2067] [SLC 2068 S] [SQE 2075K] [PMT 2075K]
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 [SLC 2064] [SLC 2065] [SLC 2069 S] [MM 2076]
A SUB procedure is a small, logical and manageable functional part of program which prefers specific task and
does not return any value. SUB-procedure is called by CALL statement. SUB-procedure’s name does not accept
data type symbol because it does not need to return a value.
8. FUNCTION procedure [SLC 2064] [SLC 2065] [SLC 2069 S] [MM 2076]
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 data type symbols such as $, %, !, #, &, etc. and it
depends on the type of value to be returned. E.g.: FUNCTION REV$ returns string.
https://seeqbasicomputer.blogspot.com/ 69 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Handling of data file
Questions and Answers [25]
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.
3. Mode of data file [SLC 2069]
Mode of data file means opening a sequential file for one of the three modes of operation like output mode, input mode and
append mode.
4. Modes of operation for opening a sequential file
a) Output Mode: It is used to create a new data file and write data in it. If the file already exists its current contents will be
destroyed.
b) Input Mode: It is used to retrieve records or contents of existing data file.
c) Append Mode: It is used to add more records in existing file. If the specified file does not exist APPEND mode creates it.
5. File number
The number assigned to a file in order to identify it during processing is called file number.
Write down the functions of:
6. OPEN statement: It opens a sequential file for one of the three possible operations (reading, writing, appending).
7. WRITE statement [SEE 2075] [MM 2076]: It sends one or more data items to the specified file. It inserts commas between
the data items. It encloses strings in double quotation marks.
8. PRINT#: It adds spaces between data items while storing data. It does not enclose strings in double quotation marks.
9. CLOSE statement [SEE 2074] [SEE 2073: It closes one or all open files.
10. INPUT# statement [SEE 2075 U] [SEE 2075 S 2]: It reads data from the sequential data file.
11. EOF( ) function [SEE 2075 S 2]: It is used to test the end of records with in a file.
12. LINE INPUT statement: It reads the entire line or maximum 255 characters form the keyboard or the sequential file.
13. INPUT$ function: It reads the specified number of characters form the data file.
14. NAME statement [SEE 2073] [SLC 2071 S]: The NAME statement renames a file on a diskette. Only file name changes,
data and program line remains intact.
15. KILL statement [SEE 2074]: The KILL statement deletes the file or files from the specified drive and directory.
16. MKDIR statement [SEE 2075 U]: 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 [SLC 2065] [SLC 2068 S]: It is used to remove or delete only the subdirectories from a disk. It can
remove only empty subdirectories.
19. FILES statement: The FILES statement displays the files of the current sub directory or specified sub directory.
20. SHELL: The SHELL statement allows a program to run external programs or command line statements in Windows, MAC
OS and Linux.
21. INT [MM 2076] [MFT 2075]: It rounds and returns the largest integer less than or equal to a numeric expression.
22. PRINT [PMT 2075K] : Display result on screen.
23. MID$ ( ) [MFT 2075]: It is a string function that returns the specified number of characters from the specified location of
string.
24. LEN ( ) [SQE 2074K]: Returns the number of characters in a string or the number of bytes required to store a variable.
25. SQR ( ) [SQE 2074K]: Returns the square root of a numeric expression.
https://seeqbasicomputer.blogspot.com/ 70 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Introduction of C
Questions and Answers [20]
1. Structured programming
The programming that follows a top- down approach, on which developers separate the overall program structure
into different sub selection, is called structured programming.
3. 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 some features 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.
5. Data types used in C language [SEE 2074] [SLC 2072] [SLC 2071 S] [SLC 2065] [SLC 2068] [SLC 2070]
[SEE 2065 S] [SLC 2066 S] [SLC 2067 S] [SLC 2069 S] [SLC 2070 S] [SQE 2074K]
a) char b) int c) float d) double
6. Data Modifiers: Data modifiers change the meaning of the basic data type to fit the various situations. The data
modifiers are: short int, unsigned int and long int
7. Characteristics of C language [SEE 2075 U] [SEE 2075 S 2] [SLC 2071] [SLC 2067] [SLC 2069]
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.
9. 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
https://seeqbasicomputer.blogspot.com/ 71 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
11. Counter
Counter is a variable which controls the loop statement and provides the track to run the loop statement in certain
number times.
12. Accumulator
Accumulator is a numeric variable which accumulates the values in a loop statement.
13. Variable [SEE 2073] [SLC 2071 S] [SLC 2070] [MFT 2075]
A variable is a location in the memory of a computer whose value may change during the execution of program.
14. Constant
Constant are the values that do not change during the execution of a program.
18. Loop [SEE 2073] [SLC 2068] [SLC 2067 S] [SLC 2070 S]
A set of statements which is used to repeat a block of statements for a specific number of times or as long as the
condition is true/false is called loop.
The looping statements provided by care:-For loop, While loop and Do.....while loop
https://seeqbasicomputer.blogspot.com/ 72 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Output: Output:
3000 -144 144 12 0
200
https://seeqbasicomputer.blogspot.com/ 73 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
9. DECLARE SUB SHOW (S) 10. DECLARE SUB VOL (L, B, H)
CLS CLS
CALL SHOW (534) LET L1 = 20
END LET B1 = 14
LET H1 = 2
SUB SHOW (N) CALL VOL(L1, B1, H1)
A = N MOD 10 END
B = N \ 10 SUB VOL (L, B, H)
C = B MOD 10 LET V = L * B * H
D = INT (N / 100) PRINT “Volume=”; V
PRINT “Ans=”; A + C + D END SUB
END SUB
Output: Output:
Ans=12 Volume=560
Output: Output:
10 10
3
17. DECLARE SUB FEBON(P, Q) 18. DECLARE FUNCTION OUT(A, B)
CLS CLS
R=2:S=1 D = OUT(17, 7)
CALL FEBON(R, S) PRINT D
END END
FUNCTION OUT(A, B)
SUB FEBON(P, Q) R = A MOD B
T=1 IF R MOD 2 = 0 THEN
PRINT P; Q; C = R MOD 6 + 30
LAB: ELSE
LET U = P + Q C = R MOD 6 + 15
PRINT U; END IF
P=Q D=C\5
Q=U OUT = D
T=T+1 END FUNCTION
IF T <=8 THEN GOTO LAB
END SUB
Output: Output:
2 1 3 4 7 11 18 29 47 76 3
https://seeqbasicomputer.blogspot.com/ 76 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
29. DECLARE SUB SERIES() 30. [SLC 2069]
CLS DELARE SUB NUMBER()
CALL SERIES CLS
END CALL NUMBER
END
SUB SERIES( ) SUB NUMBER
X#=11111 N=3
FOR I= 1 TO 5 C=1
PRINT X#^2 WHILE C<=5
X# = (X# - 1) / 10 PRINT N
NEXT I N=N*10+3
END SUB C=C+1
WEND
END SUB
Output: Output:
123454321 3
1234321 33
12321 333
121 3333
1 33333
31. DECLARE SUB CHECK () 32. DECLARE SUB FIND(N)
CALL CHECK N=654
END CALL FIND(N)
SUB CHECK END
CLS SUB FIND(N)
FOR K = 1 TO 5 WHILE N < > 0
FOR I = 5 TO K STEP -1 R= N MOD10
PRINT I; P= P*10 + R
NEXT I N= N \ 10
PRINT WEND
NEXT K PRINT P
END SUB END SUB
Output: Output:
54321 456
5432
543
54
5
https://seeqbasicomputer.blogspot.com/ 79 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
47. DECLARE SUB PATTERN (W$) 48. DECLARE SUB PATTERN(S$)
CLS B$=”PROGRAM”
LET W$=”KATHMANDU”
CALL PATTERN (W$) CALL PATTERN(B$)
END END
SUB PATTERN(S$)
SUB PATTERN (W$) H=LEN(S$)
T=5
FOR K=1 TO LEN(W$) STEP 2 I=10
PRINT TAB(T); MID$(W$,T,K) FOR J=1 TO H STEP 2
T=T-1 PRINT TAB(I); MID$(S$,J,H)
NEXT K H=H-2
END SUB
I=I+1
NEXT J
END SUB
Output: Output:
M PROGRAM
HMA ROGRA
THMAN OGR
ATHMAND G
KATHMANDU
https://seeqbasicomputer.blogspot.com/ 80 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
53. DECLARE FUNCTION OUTP$(A$()) 54. DECLARE FUNCTION RE$(ST$())
DIM A$(5) DIM ST$(7)
FOR I=1 TO 5 CLS
READ A$(I) FOR I=1 TO 7
NEXT I INPUT "Enter string"; ST$(I)
DATA NETRA, NAVIN, SUSAN, GOPAL, NEXT I
SUNIL PRINT RE$(ST$())
PRINT OUTP$(A$()) DATA “Prabhu”, “Alok”, “Bimal”, “Suman”,
END “Ishwor”, “Om”, “Nitu”
FUNCTION OUTP$(A$()) END
SWAP A$(1),A$(2)
SWAP A$(3),A$(4) FUNCTION RE$(ST$()))
FOR J=1 TO 5 FOR J = 1 TO 7
T$=T$+MID$(A$(J),J,1) VR$ = VR$ + MID$(ST$(J), I,1)
NEXT J NEXT J
OUTP$=T$ RE$=VR$
END FUNCTION END FUNCTION
Output: Output:
NEPAL PABSION
55. DECLARE FUNCTION answer$(x$) 56. DECLARE FUNCTION OUT$(A$( ))
CLS DIM A$(6)
Y$ = “Question” FOR A = 0 to 5
PRINT answer$(Y$) READ A$(A)
END NEXT A
FUNCTION answer$(x$) DATA SARITA, JEHEN, RADHIKA, ISHIKA,
FOR I = LEN(x$) to 1 STEP – 4 DILIP, BRIJESH
Z$ = MID$(x$, I, 1) + Z$ PRINT OUT$(A$( ))
NEXT i END
answer$ = Z$ FUNCTION OUT$(A$( ))
END FUNCTION CTR = 1
FOR R = 0 TO 5
T$ = T$ + MID$ (A$(R), CTR, 1)
CTR = CTR + 1
NEXT R
OUT$ = T$
END FUNCTION
Output: Output:
Sn SEDIPS
Output: Output:
48 12
https://seeqbasicomputer.blogspot.com/ 81 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
59. DECLARE FUNCTION CHECK (B) 60. DECLARE SUB NUM( )
A = 125 CLS
S=0 CALL NUM
CLS END
PRINT “OUTPUT:::”;CHECK (A) SUB NUM()
END A=3
FOR I = 1 TO 5
FUNCTION CHECK (B) PRINT A,
WHILE B<>0 IF A MOD 2 < > 0 THEN
C = B MOD 10 A = A*3+1
IF C MOD 2=1 THEN D = D + C^3 ELSE
B = INT(B/10) A =A/2
WEND ENDIF
CHECK = D NEXT I
END FUNCTION END SUB
Output: Output:
OUTPUT::: 126 3 10 5 16 8
61. DECLARE SUB RESULT(X,Y) 62. DECLARE SUB RSLT (A, B)
CALL RESULT(3,9) CALL RSLT (3, 15)
END END
https://seeqbasicomputer.blogspot.com/ 82 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
65. DECLARE SUB ABC(A) 66. DECLARE SUB OUTPOOT()
FOR I = 1 TO 5 CLS
READ N CALL OUTPOOT
CALL ABC(N) END
NEXT I
DATA 24, 15, 48, 18, 12 SUB OUTPOOT
END I=1
SUB ABC(N) N=10
R = N MOD 4 DO
R1 = N MOD 6 IF N MOD 2=0 THEN PRINT N
IF R = 0 AND R1 = 0 THEN I=I+1
PRINT N N=N+1
END IF LOOP UNTIL I>9
END SUB END SUB
Output: Output:
24 10
48 12
12 14
16
18
67. DECLARE FUNCTION CNT(ST$) 68. DECLARE FUNCTION PAB(S$)
ST$ = “COMPUTER” CLS
TOT = CNT(ST$) R$=”Today is my computer exam”
PRINT TOT PRINT PAB(R$)
END END
FUNCTION CNT(ST$)
C=1 FUNCTION PAB(S$)
DO WHILE C <= LEN(ST$) C=1
A = ASC(MID$(ST$, C, 1) FOR I = 1 TO LEN(S$)
S=S+A A$=MID$(S$,I,1)
C=C+1 IF A$= “m” THEN C=C+1
LOOP NEXT I
CNT = S PAB=C
END FUNCTION END FUNCTION
Output: Output:
623 3
https://seeqbasicomputer.blogspot.com/ 83 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
71. DECLARE FUNCTION VCOUNT(A$) 72. DECLARE FUNCTION CONV$(D)
X$=”SCHOOL” CLS
Y$=” INSTITUTE” D = 509
IF VCOUNT(S$)>VCOUNT(Y$) THEN PRINT PRINT CONV$(D)
X$ ELSE PRINT Y$ END
END FUNCTION CONV$(D)
WHILE D<>0
FUNCTION VCOUNT(A$) R = D MOD 16
N$=UCASE$(A$) IF R < 10 THEN
FOR X= 1 TO LEN(N$) S$ = STR$(R) +S$
C$=MID$(N$,I,1) ELSE
IF C$=”A” OR C$=”E” OR C$=”I” OR C$=”O” S$ = CHR$(R+55) +S$
OR C$=”U” THEN V=V+1 END IF
END IF D = D\16
NEXT X WEND
VCOUNT=V CONV$ = S$
END FUNCTION END FUNCTION
Output: Output:
INSTITUTE 1FD
73. [SEE 2075 U] 74. [SEE 2074 U]
DECLARE FUNCTION SUM ( a ) DECLARE SUB REMINDER (R)
a=9 FOR I = 1 TO 4
PRINT SUM ( a ) READ X
END CALL REMINDER (X)
NEXT I
FUNCTION SUM ( a ) DATA 56, 28, 8, 48
FOR K = 1 to a END
IF K MOD 2 = 0 THEN SUB REMINDER (R)
S=S+K R1 = R MOD 4
R2 = R MOD 3 IF
END IF
R1 = 0 AND R2<> 0 THEN
NEXT K PRINT R
SUM = S END IF
END FUNCTION END SUB
Output: Output:
20 56
28
8
https://seeqbasicomputer.blogspot.com/ 84 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Debugging [35]
1. DECLARE SUB correct( ) DECLARE SUB correct( )
CLS CLS
REM to calculate the area of rectangle REM to calculate the area of rectangle
CALL SUB correct CALL correct
END END
SUB Correct SUB Correct
INPUT “enter length”;L INPUT “enter length”;L
INPUT “enter breadth”;B INPUT “enter breadth”;B
A= LENGTH* BREADTH A= L*B
PRINT “area of rectangle=”;Area PRINT “area of rectangle=”; A
SUB END END SUB
2. Rem program to find the cube of the cube of a Rem program to find the cube of the cube of a given
given number number
DECLARE FUNCTION CUBE(R) DECLARE FUNCTION CUBE(R)
ENTER R INPUT R
DISPLAY CUBE(R) PRINT CUBE(R)
END END
FUNCTION CUBE(R) FUNCTION CUBE(R)
S=R^3 S=R^3
PRINT S CUBE = S
COMPLETE END FUNCTION
3. [SLC 2071] DECLARE SUB CUBE(N)
DECLARE SUB CUBE(N) CLS
CLS FOR I = 1 TO 5
FOR I = 1 TO 5 READ No
READ CALL CUBE(No)
CALL CUBE(No) NEXT I
NEXT X DATA 3, 5, 2, 6, 4
DATA 3, 5, 2, 6, 4 END
END SUB CUBE(N)
SUB CUBE( ) PRINT N^3
DISPLAY N^3 END SUB
END SUB
14. REM To find the sum of even digits of multi digits number REM To find the sum of even digits of multi digits number
DECLARE FUNCTION SUM (N) DECLARE FUNCTION SUM (N)
CLS CLS
INPUT “ENTER MULTI-DIGITS NUMBER ”; N INPUT “ENTER MULTI-DIGITS NUMBER ”; N
PRINT “SUM = ” ; SUM(N) PRINT “SUM = ” ; SUM(N)
END END
FUNCTION SUM(N)
WHILE N=0 FUNCTION SUM(N)
R= N MOD 10 WHILE N < > 0
IF R MOD 2 = 1 THEN S=S+R R= N MOD 10
N = N / 10 IF R MOD 2 = 0 THEN S=S+R
WEND N = N \ 10
SUM (N) =S WEND
END FUNCTION SUM =S
END FUNCTION
https://seeqbasicomputer.blogspot.com/ 87 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
15. [MM 2076] REM To check the input no. is perfect square or not
REM To check the input no. is perfect square or not DECLARE FUNCTION chk$ (a)
DECLARE FUNCTION chk$ (a) CLS
CLS INPUT “Enter the number :”; a
INPUT “Enter the number :”; a PRINT chk$ (a)
CALL chk$ (a) END
END
FUNCTION chk$(a) FUNCTION chk$(a)
m=SQUARE (a) m=SQR (a)
n=INT (m) n=INT (m)
IF m=a THEN IF m=n THEN
c$=”Perfect Square” c$=”Perfect Square”
ELSE ELSE
c$=”Not Perfect Square” c$=”Not Perfect Square”
END IF END IF
C$=chk$ chk$ = c$
END FUNCTION END FUNCTION
16. [SEE 2074] REM TO find the factorial of a given number.
REM TO find the factorial of a given number. DECLARE FUNCTION FACTO (N)
DECLARE FUNCTION FACTO (N$) CLS
CLS INPUT "Enter a number", X
INPUT "Enter a number", X PRINT "The Factorial is: ", FACTO (X)
PRINT "The Factorial is: ", FACTO (N) END
END FUNCTION FACTO (N)
FUNCTION FACTO (N) F=1
F=1 WHILE N < > 0
WHILE N = 0 F = F*N
F = F*N N=N-1
N=N-1 WEND
WEND FACTO = F
F = FACTO END FUNCTION
END FUNCTION
17. DECLARE SUB FACT (N) DECLARE SUB FACT (N)
REM PRINT FACTORS OF INPUT NUMBER REM PRINT FACTORS OF INPUT NUMBER
WITH SUB PROCEDURE WITH SUB PROCEDURE
INPUT “ENTER NUMBER:”, A INPUT “ENTER NUMBER:”, A
CALL FACT(N) CALL FACT(A)
END END
SUB FACT (N) SUB FACT (N)
FOR K=1 TO N FOR K=1 TO N
IF N MOD K =1 THEN IF N MOD K =0 THEN
PRINT K PRINT K
IF END END IF
END FUNCTION END SUB
18. REM TO FIND LONGEST NAME REM TO FIND LONGEST NAME
DECLARE FUNCTION LONGETS$(A$, B$, C$) DECLARE FUNCTION LONGETS$(A$, B$, C$)
INPUT A$, B$, C$ INPUT A$, B$, C$
PRINT LONGEST(A$, B$, C$) PRINT LONGEST$(A$, B$, C$)
END END
FUNCTION LONGEST$(A$, B$, C$) FUNCTION LONGEST$(A$, B$, C$)
A = LEN$(A$) A = LEN(A$)
B = LEN(B$) B = LEN(B$)
C = LEN(C$) C = LEN(C$)
IF A > B OR A > C THEN IF A > B AND A > C THEN
A$ = L$ L$ =A$
ELSEIF B > A OR B > C THEN ELSEIF B > A AND B > C THEN
L$ = B$ L$ = B$
ELSE ELSE
L$ = C$ L$ = C$
END IF END IF
LONGEST$(A$, B$, C$) = L$ LONGEST$ = L$
FUNCTION END END FUNCTION
https://seeqbasicomputer.blogspot.com/ 88 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
19. [SEE 2075] DECLARE FUNCTION reverse$ (N$)
DECLARE FUNCTION reverse$ (N$) INPUT "Any String"; N$
INPUT "Any String"; N$ X$ = reverse$(N$)
X$ = reverse$(N$) PRINT X$
PRINT N$ END
END FUNCTION reverse$ (N$)
FUNCTION reverse (N$) L = LEN (N$)
L = LEN$(N$) FOR X = L To 1 STEP - 1
FOR X = L To 1 STEP - 1 A$ = MID$ (N$,X,1)
A$ = MID$ (N$,X,1) B$ = B$+A$
B$ = B$+A$ NEXT X
NEXT X reverse$ =B$
B$ = reverse$ (N$) END FUNCTION
END FUNCTION
20. [SLC 2069] [SLC 2069]
Rem program to reverse the string or word Rem program to reverse the string or word
DECLARE SUB REV(W$) DECLARE SUB REV(W$)
CLS CLS
INPUT “Enter a word”;W$ INPUT “Enter a word”;W$
CALL REV(W$) CALL REV(W$)
END END
SUB REV(W$) SUB REV(W$)
FOR I=LEN(W$) to 1 step -1 FOR I=LEN(W$) to 1 step -1
C$=LEFT$(W$,I,1) C$=MID$(W$,I,1)
S$=D$+1 S$=S$+C$
LOOP NEXT I
PRINT “Reverse string is:”; D$ PRINT “Reverse string is:”; S$
CLOSE SUB END SUB
https://seeqbasicomputer.blogspot.com/ 89 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
23. REM do display the reverse of the supplied number REM do display the reverse of the supplied number
DECLARE FUNCTION rev(n) DECLARE FUNCTION rev(n)
CLS CLS
INPUT n INPUT n
PRINT rev(n) PRINT rev(n)
END END
https://seeqbasicomputer.blogspot.com/ 90 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
27. [SLC 2068 S] [SLC 2068 S]
Rem to display the contents of a data file. Rem to display the contents of a data file.
OPEN “Marks.dat” FOR OUTPUT AS #1 OPEN “Marks.dat” FOR INPUT AS #1
CLS CLS
WHILE EOF(1) WHILE NOT EOF(1)
INPUT #1, Name$, Age, Add$ INPUT #1, Name$, Age, Add$
DISPLAY Name$, Age, Add$ PRINT Name$, Age, Add$
WEND WEND
CLOSE 1 CLOSE #1
END END
28. [SLC 2069] [SLC 2069]
REM display Records of students From Data File REM display Records of students From Data File
OPEN “STDREC.DAT” FOR INP AS #1 OPEN “STDREC.DAT” FOR INPUT AS #1
PRINT PRINT “ROLL”, “NAME”, “ADDRESS”, “CLASS”,
“ROLL”,”NAME”,”ADDRESS”,”CLASS”,”SECTION” “SECTION”
DO WHILE NOT EOF DO WHILE NOT EOF(1)
INPUT #1,RN,N$,AD$,CL,S$ INPUT #1, RN, N$, AD$, CL, S$
PRINT RN,N$,AD$,CL,S$ PRINT RN, N$, AD$, CL, S$
NEXT LOOP
CLOSE #1 CLOSE #1
END END
29. [SLC 2066 S] [SLC 2066 S]
REM To store Name, post and salary REM To store Name, post and salary
OPEN “EMP.DOC” FOR OUT AS #1 OPEN “EMP.DOC” FOR OUTPUT AS #1
INPUT” Enter name”;N INPUT” Enter name”;N$
INPUT” Enter post”;P$ INPUT” Enter post”;P$
INPUT “Enter salary”;S INPUT “Enter salary”;S
WRITE #2, N$,P$, S WRITE #1, N$, P$, S
CLOSE #1 CLOSE #1
END END
30. REM COPY THE DATA OF “SRC.INF” TO REM COPY THE DATA OF “SRC.INF” TO “DEST.INF”
“DEST.INF” OPEN “SRC.INF” FOR INPUT AS #1
OPEN “SRC.INF” FOR INPUT AS #1 OPEN “DEST.INF” FOR OUTPUT AS #2
OPEN “DEST.INF” FOR OUTPUT AS #2 CLS
CLS WHILE NOT EOF( 1)
WHILE NOT EOF( ) INPUT #1, NM$, RN, AGE
INPUT #2, NM$, RN, AGE WRITE #2, NM$, RN, AGE
WRITE #1, NM$, RN, AGE WEND
CLOSE #1, #2 CLOSE #1, #2
END END
31. [SLC 2070 S] OPEN "STUDENT.DAT" FOR APPEND AS #1
OPEN "STUDENT.DAT" FOR APPEND AS 1# INPUT "NAME"; N$
INPUT "NAME"; N$ INPUT "ADDRESS"; ADD$
INPUT "ADDRESS"; ADD$ INPUT "AGE"; AGE
INPUT "AGE"; AGE$ WRITE #1, N$, ADD$, AGE
WRITE #1, N$, ADD$, AGE CLOSE # 1
END# 1 END
STOP
https://seeqbasicomputer.blogspot.com/ 91 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
33. [SEE 2074 U]
Rem To print only class 10 record from "student.dat" Rem To print only class 10 record from “student.dat”
CLS CLS
OPEN "I",#2, "Student.Dat" OPEN “I” , #2 , “Student.Dat”
WHILE NOT EOF (#2) WHILE NOT EOF (2)
WRITE#2, N$,C,R INPUT #2, N$, C, R
IF C=10 THEN IF C=10 THEN
DISPLAY N$,C,R PRINT N$, C, R
END IF END IF
NEXT WEND
CLOSE #2 CLOSE #2 END
END
34. [SQE 2075K]
REM to copy from old file to new file REM to copy from old file to new file
OPEN "info.dat" for INPUT AS #1 OPEN "info.dat" for INPUT AS #1
OPEN "temp.dat" for OUTPUT AS #2 OPEN "temp.dat" for OUTPUT AS #2
DO UNTIL EOF(1) DO UNTIL EOF(1)
INPUT #2, n$, p$, d$, s INPUT #1, n$, p$, d$, s
WRITE #1, n$, p$, d$, s WRITE #2, n$, p$, d$, s
WEND LOOP
CLOSE #2, #2 CLOSE #1, #2
END END
35. [SQE 2074K]
REM to print only male record on the printer from the REM to print only male record on the printer from the
data file. data file.
OPEN "EMP.DAT" FOR OUTPUT AS #1 OPEN "EMP.DAT" FOR INPUT AS #1
DO DO
INPUT #4, N$, A%, S$ INPUT #1, N$, A%, S$
SELECT CASE S SELECT CASE S$
CASE MALE CASE "MALE"
PRINT N$, A%, S$ PRINT N$, A%, S$
END SELECT END SELECT
LOOP UNTIL EOF(1) LOOP UNTIL EOF(1)
STOP #1 CLOSE #1
END
https://seeqbasicomputer.blogspot.com/ 92 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Analytical Questions [40]
1. DECLARE SUB TEST(A, B, C)
LET X=4
LET Y=7
LET Z=12
CALL TEST (X, Y, Z)
PRINT X, Y, Z
END
SUB TEST(A, B, C)
A=A+3
B=B+2
SUM=A+B+C/3
PRINT SUM
END SUB
i) What happens if CALL TEST(X, Y, Z) is replaced by CALL TEST(A, B, C)
Ans: If CALL TEST(X, Y, Z) is replaced by CALL TEST(A, B, C) then the output will be:
5
4 7 12
ii) List the formal and real parameters used in the above program.
Ans: Formal Parameters = A, B, C
Real Parameters = X, Y, Z
https://seeqbasicomputer.blogspot.com/ 93 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
4. [SEE 2075 S2]
DECLARE SUB TRIM (W$)
CLS
INPUT "Enter word" ; WO$
CALL TRIM (WO$)
END
SUB TRIM (WO$)
FOR I = 1 TO LEN (W$)
PRINT LEFT$ (W$, I)
NEXT I
END SUB
i. What will be the output if input string is "SEE" in the above program?
Output
S
SE
SEE
ii. List the real parameter used in the above program.
Ans: Real parameter is WO$
5. DECLARE FUNCTION ADD(N)
CLS
FOR CNT= 1 TO 3
READ NUM
PRINT ADD (NUM)
NEXT CNT
DATA 8, 7, 3
END
FUNCTION ADD(N)
S=0
FOR G=1 TO N
S=S+G
NEXT G
ADD=S
END FUNCTION
i. Name the actual and formal parameter used in above program.
Ans: Actual parameter = NUM
Formal parameter = N
ii. What is the value of NUM when the value of CNT is 2?
Ans: The value of NUM will be 7 when the value of CNT is 2.
6. [SQE 2075K]
DECLARE SUB SERIES(A, R, N)
CLS
INPUT "ENTER FIRST TERM"; X
INPUT "NUMBER OF TERMS TO BE GENERATED:"; Z
CALL SERIES (X,Y,Z)
END
FUNCTION Num(N)
X=Int(17/N)
Y=15 MOD N
Num=X +Y
END FUNCTION
i. Write the name of the function used in the above program.
Ans: The name of the function is Num.
ii. List out the mathematical function (Library function) used in the above program.
Ans: The library function is Int( )
https://seeqbasicomputer.blogspot.com/ 96 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
13. [SEE 2073]
DECLARE FUNCTION Diff (A, B)
CLS
INPUT "Enter first number" ; A
INPUT "Enter second number" ; B
PRINT "The difference" ; Diff (A, B)
END
FUNCTION Diff (A, B)
difference = A - B
Diff = difference
END FUNCTION.
a) List all the numeric variables used in the above program.
Ans: The numeric variables are A, B and difference.
b) List the local variables used in the above program.
Ans: The local variables are A, B and difference
https://seeqbasicomputer.blogspot.com/ 97 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
16. [SLC 2072]
DECLARE FUNCTION Prod (N)
INPUT "Any Number"; N
X = Prod (N)
PRINT x
END
FUNCTION Prod (N)
F= 1
FOR K = 1 TO N
F=F*K
NEXT K
Prod = F
END FUNCTION
a) Write the name of the user defined function used in above program.
Ans: The name of the user defined function used in above program is Prod.
b) Name the loop in above program?
Ans: The name of loop is FOR….NEXT loop.
[SLC 2069 S]
17. DECLARE FUNCTION CHK$(N)
N=57
PRINT “The number is”; CHK$(N)
END
FUNCTION CHK$(N)
FOR I = 1 TO N
IF N MOD I = 0 THEN C=C+1
NEXT I
IF C>2 THEN
CHK$=”Composite”
ELSE
CHK$=”Prime”
END IF
END FUNCTION
i. Will the above program execute if “DECLARE FUNCTION….” is deleted.
Ans: Yes, the program will run if the first line (i.e. DECLARE…) is deleted.
ii. Why $ sign is used in the name of the above function.
Ans: $ sign is used in the name of the above function because the function returns string value.
18. [SQE 2074K]
DECLARE SUB PATTRA (N)
N=7
CALL PATTRA(N)
END
SUB PATTRA(N)
FOR I = 1 to 5
PRINT N
IF N MOD 2 = 1 THEN
N = (N*2) + 1
ELSE
N=N/2
END IF
NEXT I
END SUB
a) Write the output of the above program?
Ans: The output is:
7
15
31
63
127
b) Write down the function of MOD in the above program.
Ans: The function of MOD operator is to find the remainder.
https://seeqbasicomputer.blogspot.com/ 98 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
19. [SLC 2068]
Declare function count(N$)
Input “Enter a word”; R$
C= Count(R$)
Print C
END
Function count(N$)
For k=1 to LEN(n$)
X$=MID$(N$,K,1)
IF UCASE$(X$)=”A” then
X=X+1
End if
Next K
Count = X
End function
i) List any two library functions used in the above program.
Ans: Any two library functions are LEN( ) and MID$( ).
ii) Write the use of variable ‘C’ inline 3 [i.e. C=Count(R$)] given in the above program.
Ans: The use of variable ‘C’ is to store the value returned by the function count.
20. [PMT 2075]
DECLARE SUB OT (N$)
N$ = "Computer Science"
CALL OT(N$)
END
SUB OT (N$)
B = LEN(N$)
c=1
WHILE c <= B
m$ = MID$(N$, c, 1)
PRINT m$;
c=c+2
WEND
END SUB
a. What is the value of B in the above program?
Ans: The value of B is 16 in the above program.
b. How many parameters are used in the above sub procedure?
Ans: Only one parameter is used in the above program.
21. [SLC 2066 S]
DECLARE FUNCTION COUNT(A$)
Input “Enter a word”; W$
END
Function Count(A$)
B=LEN(A$)
C$=UCASE$(A$)
FOR I=1 TO B
E$=MID$(C$,I,1)
IF E$=”A” OR E$=”E” OR E$=”I” OR E$=”O” OR E$=”U” THEN C=C+1
END IF
NEXT I
COUNT=C
END FUNCTION
i. List the string Library functions used in the above program.
Ans: The string Library functions used in the above program are LEN( ), UCASE$( ) and MID$( ).
ii. Write down the missing statements in the main module to execute the program.
Ans: The missing statements in the main module to execute the program is PRINT COUNT(W$)
https://seeqbasicomputer.blogspot.com/ 99 | P a g e
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
22. [SLC 2071]
DECLARE SUB Stde(N$U)
FOR Loop = 1 TO 5
READ NM$(Loop)
NEXT Loop
DATA RAMA, PRATIMA, PRASANT
DATA NISHA, RUDHRA
CALL Stde(NM$U)
END
SUB Stde(N$U)
PRINT “Name starting from P”
FOR J = 1 TO 5
C$=MID$(N$,(J),1,1)
IF C$=”P” THEN
PRINT N$(J)
END IF
NEXT J
END SUB
i. List the library function used in the above program.
Ans: The library function used in the above program is MID$( ).
ii. List the conditional statement used in the above program.
Ans: The conditional statement used in the above program is IF….THEN (i.e. IF C$ = “P” THEN).
https://seeqbasicomputer.blogspot.com/ 100 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
24. [SLC 2071 S]
DECLARE FUNCTION JPT (N)
FOR ctr = 1 TO 6
READ N
J = JPT (N)
Sum = Sum + J
NEXT ctr
PRINT Sum
DATA 10, 20, 30, 40, 50, 60
END
https://seeqbasicomputer.blogspot.com/ 101 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
27. DECLARE SUB SUM (N)
N=5
CALL SUM (N)
END
SUB SUM (N)
FOR X = 1 TO N
S=S+X
NEXT X
PRINT S
END SUB
a) In the above program how many times does the FOR ........ NEXT loop executes ?
The FOR … NEXT loop executes 5 times.
b) Write the name of the procedure used in the above program.
The name of the procedure used in the above program is SUM.
https://seeqbasicomputer.blogspot.com/ 102 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
30. DECLARE FUNCTION A(X)
X=5
Z=A(X)
PRINT Z
END
FUNCTION A(X)
FOR I = 1 TO X
S=S+I
NEXT I
A=S
END FUNCTION
a) How many parameters are used in the program?
Ans: One parameter is used.
b) How many times execute the expression S=S+I in the above program?
Ans: The expression S=S+I will be executed five times in the above program
c) If the line S = S + I is changed to S = S + I ^ 2 then find the output.
Ans: The output is: 15
https://seeqbasicomputer.blogspot.com/ 103 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
33. [SLC 2067]
DECLARE SUB SUM(N)
INPUT”ANY NUMBER”;N
CALL SUM(N)
END
SUB SUM(N)
S=0
WHILE N<>0
R=N MOD 10
S=S+R
N=N\10
WEND
PRINT “SUM”;S
END SUB
a) In which condition the statements within the WHILE….WEND looping statement will not be executed?
Ans: When the condition is false (i.e. Value of N=0) , the statements within the WHILE….WEND looping
statement will not be executed
b) Will the output be the same if we place “/” instead of”\” in the above program.
Ans: No. the output will not same if we place “/” instead of”\” in the above program.
https://seeqbasicomputer.blogspot.com/ 104 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
35. [SLC 2064]
DECLARE FUNCTION CELLS$(W$)
W$=”CYBER”
PRINT CELL$(W$)
END
FUNCTION CELL$
K=LEN(W$)
FOR I = K TO 1 STEP -2
M$=M$+MID$(W$,I,1)
NEXT I
CELLS$=M$
END FUNCTION
a) Why is $(dollar) sign followed in the function name?
Ans: $(dollar) sign followed in the function name because the function returns string value.
b) What will be the output of the program when it is executed?
Ans: The output is : CBR
c) What will be the output of the program when FOR loop is changed as FOR I= 1 TO K STEP 2?
Ans: The output is: RBC
d) What is the name of sign “+” used in the program and what operation does it perform?
Ans: The name of sign “+” is string operator and it is used to join the string i.e. string concatenation.
36. [SLC 2070]
DECLARE FUNCTION Sum(A,B)
INPUT “Enter first number:”; A
INPUT “Enter second number:”; B
PRINT “The sum of the two number=”;Sum(A,B)
END
FUNCTION SUM(A,B)
S=A+B
Sum=S
END FUNCTION
a) List the numerical variables used in the above program.
Ans: The numerical variables used in the above program are S, A and B.
b) Will the program run if the first line (i.e. DECLARE….) is deleted?
Ans: Yes, the program will run if the first line (i.e. DECLARE….) is deleted
37. [SLC 2070 S]
DECLARE FUNCTION rev$ (N$)
INPUT "Any string"; N$
PRINT rev$ (N$)
END
FUNCTION rev$ (N$)
FOR X = LEN (N$) to 1 STEP -1
A$=MID$ (N$, X, 1)
B$ = B$ + A$
NEXT X
rev$ = B$
END FUNCTION
a. List the library function used in the above program.
Ans: The library function used in the above program are LEN( ) and MID$( )
b. What will be the maximum value of X if the N$ is equal to "Computer".
Ans: be the maximum value of X if the N$ is equal to "Computer" is 8.
https://seeqbasicomputer.blogspot.com/ 105 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
38. [SEE 2074]
DECLARE FUNCTION SUM (N)
INPUT "Enter any number", N
S = SUM (N)
PRINT "The Sum of individual digit is:", S
END
FUNCTION SUM (N)
WHILE N > 0
R = N MOD 10
T=T+R
N = N\10
WEND
SUM = T
END FUNCTION.
State the purpose of using variable S in line 4 in above program.
Ans: The purpose of using variable S in line 4 in above program is to store the value returned by the function SUM.
Write the use of MOD in above program.
Ans: The use of MOD operator is to return the remainder.
https://seeqbasicomputer.blogspot.com/ 106 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Qbasic Programming Questions [180]
1. Using FUNCTION…END 2. Write a program using SUB to find 3. Using FUNCTION, write a program
FUNTION, write a program to the average of any two numbers given to calculate the sum, product, average
calculate the average of three numbers by the user. and difference of two numbers.
DECLARE FUNCTION AVERAGE (A, DECLARE SUB AVERAGE (A, B) DECLARE FUNCTION SUM (A, B)
B, C) CLS DECLARE FUNCTION DIFF (A, B)
CLS INPUT “ENTER FIRST NUMBER”; A DECLARE FUNCTION PROD (A, B)
INPUT “ENTER FIRST NUMBER”; A INPUT “ENTER SECOND NUMBER”; DECLARE FUNCTION AVERAGE (A,
INPUT “ENTER SECOND NUMBER”; B B)
B CALL AVERAGE (A, B) CLS
INPUT “ENTER THIRD NUMBER”; C END INPUT “ENTER FIRST NUMBER”; A
PRINT “AVERAGE OF THREE INPUT “ENTER SECOND NUMBER”;
NUMBERS”; AVERAGE (A, B, C) SUB AVERAGE (A, B) B
AV = (A + B) / 2 PRINT “SUM OF TWO NUMBERS”;
FUNCTION AVERAGE (A, B, C) PRINT “AVERAGE OF TWO SUM (A, B)
AVERAGE = (A + B + C) / 3 NUMBERS”; AV PRINT “DIFFERENCE OF TWO
END FUNCTION END SUB NUMBERS”; DIFF (A, B)
PRINT “PRODUCT OF TWO
4. Using FUNCTION, write a program 5. Write a program in QBASIC to find NUMBERS”; PROD (A, B)
to input any five numbers and display square of a given number using PRINT “AVERAGE OF TWO
their sum using array (DIM) FUNCTION…..END FUNCTION. NUMBERS”; AVERAGE (A, B)
DECLARE FUNCTION SUM (N ( )) END
CLS DECLARE FUNCTION SQUARE (N)
DIM N( 5) CLS FUNCTION SUM (A, B)
FOR I = 1 TO 5 INPUT “ENTER ANY NUMBER”; N SUM = A + B
INPUT "Enter any 5 numbers"; N (I) PRINT “SQUARE OF NUMBER “; END FUNCTION
NEXT I SQUARE (N)
PRINT "Sum of any 5 numbers is"; END FUNCTION DIFF (A, B)
SUM(N ( )) DIFF = A - B
END FUNCTION SQUARE (N) END FUNCTION
FUNCTION SUM (N ( )) SQUARE = N ^ 2
FOR I = 1 TO 5 END FUNCTION FUNCTION PROD (A, B)
S = S + N (I) PROD = A * B
NEXT I END FUNCTION
SUM = S
END FUNCTION FUNCTION AVERAGE (A, B)
AVERAGE = (A + B) / 2
END FUNCTION
6. Write a program in QBASIC to find 7. Write a program in QBASIC to find 8. Write a program in QBASIC to find
square root of a given number using cube of a given number using cube root of a given number using
SUB…..END SUB. SUB…..END SUB. FUNCTION…..END FUNCTION.
DECLARE SUB SQROOT (N) DECLARE SUB CUBE (N) DECLARE FUNCTION CBROOT (N)
CLS CLS CLS
INPUT “ENTER ANY NUMBER”; N INPUT “ENTER ANY NUMBER”; N INPUT “ENTER ANY NUMBER”; N
CALL SQROOT (N) CALL CUBE (N) PRINT “CUBE ROOT OF NUMBER “;
END END CBROOT (N)
END
SUB SQROOT (N) SUB CUBE (N)
S = N ^ (1 / 2) C=N^3 FUNCTION CBROOT (N)
PRINT “SQUARE ROOT OF NUMBER PRINT “CUBE OF NUMBER “; C CBROOT = N ^ (1 / 3)
“; S END SUB END FUNCTION
END SUB
https://seeqbasicomputer.blogspot.com/ 107 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
9. Write a program in QBASIC to find 10. Write a program to calculate and 11. Using FUNCTION, write a
the sum of cube of two input numbers print the simple interest using program to calculate distance travelled
using SUB…..END SUB FUNCTION……END FUNCTION. by a body. (Hint: s=ut+ (1/2) at2)
DECLARE SUB CUBE (A, B,) DECLARE FUNCTION INTEREST (P, DECLARE FUNCTION DISTANCE (U,
CLS T, R) T, A)
INPUT “ENTER FIRST NUMBER”; A CLS CLS
INPUT “ENTER SECOND NUMBER”; INPUT “ENTER PRINCIPAL”; P INPUT “ENTER INITIAL
B INPUT “ENTER TIME”; T VELOCITY”; U
CALL CUBE (A, B) INPUT “ENTER RATE”;R INPUT “ENTER TIME”; T
END PRINT “SIMPLE INTEREST=”; INPUT “ENTER ACCELARATION”; A
INTEREST (P, T, R) PRINT “DISTANCE TRAVELLED = “;
SUB CUBE (A, B) END DISTANCE (U, T, A)
C=A^3+B^3 END
PRINT “SUM OF CUBE OF TWO FUNCTION INTEREST (P, T, R)
NUMBERS “; C I = P* T * R / 100 FUNCTION DISTANCE (U, T, A)
END SUB INTEREST = I DISTANCE = U * T + 1 / 2 * A * T ^ 2
END FUNCTION END FUNCTION
12. Using FUNCTION……END 13. Using FUNCTION……END 14. Write a program using
FUNCTION, write a program to read FUNCTION, write a program to input SUB……END SUB to find the area of
perpendicular and base of a right cost price and selling price from the rectangle. [A=L*B]
angled triangle to find hypoteneous. keyboard to calculate profit.
DECLARE SUB AREA (L, B)
DECLARE FUNCTION HYP(P, B) DECLARE FUNCTION PROFIT (CP, CLS
CLS SP) INPUT “ENTER LENGTH”; L
INPUT "ENTER PERPENDICULAR"; CLS INPUT “ENTER BREADTH”; B
P INPUT “ENTER COST PRICE”; CP CALL AREA (L, B)
INPUT "ENTER BASE"; B INPUT “ENTER SELLING PRICE”; SP END
PRINT "HYPOTENUSE="; HYP (P, B) PRINT “PROFIT AMOUNT=”; PROFIT
END (CP, SP) SUB AREA (L, B)
FUNCTION HYP (P, B) END A=L*B
HYP = (P ^ 2 + B ^ 2) ^ (1 / 2) FUNCTION PROFIT (CP, SP) PRINT “AREA OF RECTANGLE=”; A
END FUNCTION P = SP – CP END SUB
PROFIT = P
END FUNCTION
15. Write a program using 16. Write a program using 17.Write a program in QBASIC to
FUNCTION……END FUNCTION to SUB……END SUB to find the area find the area of four wall of a room
find the perimeter of rectangle. and perimeter of square. [P=4L] using FUNCTION…..END
[P=2(L+B)] [A=L2] FUNCTION.
DECLARE FUNCTION PER (L, B) DECLARE SUB AREA (L) DECLARE FUNCTION AREA (L, B,
CLS DECLARE SUB PERIMETER (L) H)
INPUT “ENTER LENGTH”; L CLS CLS
INPUT “ENTER BREADTH”; B INPUT “ENTER LENGTH”; L INPUT “ENTER LENGTH”; L
PRINT “PERIMETER OF CALL AREA (L) INPUT “ENTER BREADTH”; B
RECTANGLE”; PER (L, B) CALL PERIMETER (L) INPUT “ENTER HEIGHT”; H
END END PRINT “AREA OF FOUR WALLS”;
AREA(L, B, H)
FUNCTION PER (L, B) SUB AREA (L) END
PER = 2 * (L + B) A=L^2
END FUNCTION PRINT “AREA OF SQUARE”; A FUNCTION AREA (L, B, H)
END SUB A = 2 * H * (L + B)
AREA = A
SUB PERIMETER (L) END FUNCTION
P=4*L
PRINT “PERIMETER OF SQUARE”; P
END SUB
https://seeqbasicomputer.blogspot.com/ 108 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
18.Write a sub program cost (l,b,h,c) to 19.Write a program using 20.Write a program to calculate the
find the cost of painting the four walls of FUNCTION…END FUNCTION to area of triangle by using
a room. find area of the triangle. SUB…..END SUB.
[Hints:
DECLARE SUB AREA (L, B, H, C) DECLARE FUNCTION AREA (B, H)
Area=
s(s − a )(s − b)(s − c ) ]
CLS CLS
INPUT “Enter Length”; L INPUT “ENTER BREADTH”; B
INPUT “Enter Breadth”; B INPUT “ENTER HEIGHT”; H DECLARE SUB AREA (A, B, C)
INPUT “Enter Height”; H PRINT “AREA OF TRIANGLE ”; CLS
INPUT “Enter Cost”; C AREA( B, H) INPUT “ENTER VALUE FOR FIRST
CALL AREA (L, B, H, C) END SIDE ”; A
END INPUT “ENTER VALUE FOR
FUNCTION AREA (B, H) SECOND SIDE ”; B
SUB AREA (L, B, H, C) A = 1 / 2 * (B * H) INPUT “ENTER VALUE FOR THIRD
A = 2 * H * (L + B) AREA = A SIDE ”; C
T=A*C END FUNCTION CALL AREA (A, B, C)
PRINT “Cost of painting area of four walls END
is”; T
END SUB SUB AREA (A, B, C)
S = (A + B + C) / 2
AR = (S * (S – A) * (S – B) * (S – C)) ^
(1 / 2)
PRINT “AREA OF TRIANGLE”; AR
END SUB
21.Write a program using SUB….END 22.Write a program using 23.Write a program using
SUB to get radius of circle and then print FUNCTION….END FUNCTION to FUNCTION…END FUNCTION to
its circumference. [C=2R] get radius of the circle and display get radius of circle and then print its
the area. area and circumference.
DECLARE SUB CIRCUM (R)
CLS DECLARE FUNCTION AREA (R) DECLARE FUNCTION AREA (R)
INPUT “ENTER RADIUS”; R CLS DECLARE FUNCTION CIRCUM (R)
CALL CIRCUM (R) INPUT “ENTER RADIUS”; R CLS
END PRINT “AREA OF CIRCLE ”; INPUT “ENTER RADIUS”; R
AREA(R) PRINT “AREA OF SQUARE ”;
SUB CIRCUM (R) END AREA(R)
C = 2 * 3.14 * R PRINT “CIRCLE OF
PRINT “CIRCUMFERENCE OF CIRCLE FUNCTION AREA (L, B) CIRCUMFERENCE”; CIRCUM (R)
”; C A = 3.14 * R ^ 2 END
END SUB AREA = A
END FUNCTION FUNCTION AREA (R)
AREA = 3.14 * R ^ 2
END FUNCTION
https://seeqbasicomputer.blogspot.com/ 109 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
27.Write a function procedure to read 28.Write a program using Function 29.Write a program to create a
the side of a cube. Calculate its volume Module to calculate and print the procedure using SUB...END SUB to
and surface area. (Hint: vol=side 3 and volume of a box / cuboid. [ V=L*B*H] input the value of length, breadth and
sa=6 side2] height of a box. The program should
DECLARE FUNCTION VOLUME (L, calculate the area and volume of the
DECLARE FUNCTION TSAREA (L) B, H) box.
DECLARE FUNCTION VOLUME (L) CLS DECLARE FUNCTION TSAREA (L, B,
CLS INPUT “ENTER LENGTH”; L H)
INPUT “ENTER LENGTH”; L INPUT “ENTER BREADTH”; B DECLARE FUNCTION VOLUME (L,
PRINT “TOTAL SURFACE AREA OF INPUT “ENTER HEIGHT”; H B, H)
CUBE ”; TSAREA(L) PRINT “VOLUME OF CUBOID ”; CLS
PRINT “VOLUME OF CUBE ”; VOLUME(L, B, H) INPUT “ENTER LENGTH”; L
VOLUME(L) END INPUT “ENTER BREADTH”; B
END INPUT “ENTER HEIGHT”; H
FUNCTION VOLUME (L, B, H) PRINT “TOTAL SURFACE AREA OF
FUNCTION TSAREA (L) VOLUME = L * B * H CUBOID ”; TSAREA(L, B, H)
TSAREA = 6 * L ^ 2 END FUNCTION PRINT “VOLUME OF CUBOID ”;
END FUNCTION VOLUME(L, B, H)
END
FUNCTION VOLUME (L)
VOLUME = L ^ 3 FUNCTION TSAREA (L, B, H)
END FUNCTION TSAREA = 2 * (L * B + B * H + H * L)
END FUNCTION
https://seeqbasicomputer.blogspot.com/ 110 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
36.WRITE A PROGRAM to ask a 37.Write a program to input distance 38.Write a program to input days
number as paisa and convert them in kilometre and convert into meter and convert into years, months and
into corresponding rupees only solve using function procedure. days using sub procedure.
it using SUB Procedure.
DECLARE FUNCTION CONVERT DECLARE SUB CONVERT(D)
DECLARE SUB CONVERT (P) (K) CLS
CLS CLS INPUT “ENTER DAYS”; D
INPUT “ENTER VALUE IN PAISE”; INPUT “ENTER DISTANCE IN CALL CONVERT(D)
P KILOMETER”; K END
CALL CONVERT (P) PRINT “DISTANCE IN METER=”; SUB CONVERT (D)
END CONVERT (K) Y = D \ 365
END MO = D MOD 365
SUB CONVERT (P) M = MO \ 30
R = P / 100 FUNCTION CONVERT (K) D = MO MOD 30
PRINT “Rupees=”; R M = K * 1000 PRINT Y; “YEARS ” ; M;
END SUB CONVERT = M “MONTHS”; D; “DAYS”
END FUNCTION END SUB
39.Write a program to input seconds 40.Write a function convert (N) to 41.Write a program to input any
and convert into hours minutes and read a number in inches and convert number and check whether the given
seconds using sub procedure. it into feet and inches. no. is divisible by 3 and 7 or not using
[1 foot = 12 inches] function procedure.
DECLARE SUB CONVERT(S)
CLS DECLARE FUNCTION DECLARE FUNCTION CHECK$ (N)
INPUT “ENTER TIME IN CONVERT(N) CLS
SECONDS”; S CLS INPUT “Enter any number”; N
CALL CONVERT(S) INPUT "ENTER VALUE IN PRINT “The given number is ”;
END INCHES"; N CHECK$(N)
SUB CONVERT (S) PRINT CONVERT(N); "FEET"; IN; END
H = S \ 3600 "INCHES"
MI = S MOD 3600 END FUNCTION CHECK$ (N)
M = MI \ 60 FUNCTION CONVERT (N) IF N MOD 3 = 0 AND N MOD 7 = 0
S = MI MOD 60 SHARED IN THEN
PRINT H; “HOURS”; M; IN = N MOD 12 CHECK$ = “divisible by 3 and 7”
“MINUTES”; S; “SECONDS” CONVERT = N \ 12 ELSE
END SUB END FUNCTION CHECK$ = “not divisible by 3 and 7”
END IF
END FUNCTION
42.Using SUB…END SUB, write a 43.Write a program to declare a sub 44.Write a function program to find
program to test whether the given procedure module to decide whether whether the given number is perfect
number is completely divisible by 13 an input no is multiple of 5 or not. number or not.
or not. DECLARE FUNCTION PERFECT (N)
DECLARE SUB CHECK (N) CLS
DECLARE SUB CHECK (N) CLS INPUT "ENTER ANY NUMBER"; N
CLS INPUT “ENTER ANY NUMBER”; N PR = PERFECT (N)
INPUT “ENTER ANY NUMBER”; N CALL CHECK (N) IF PR = N THEN
CALL CHECK (N) END PRINT "PERFECT NUMBER"
END SUB CHECK (N) ELSE
SUB CHECK (N) IF N MOD 5 = 0 THEN PRINT "NOT PERFECT NUMBER"
IF N MOD 13 = 0 THEN PRINT “The given number is multiple END IF
PRINT “The given number is divisible of 5” END
by 13” ELSE FUNCTION PERFECT (N)
ELSE PRINT “The given number is not S=0
PRINT “The given number is not multiple of 5” FOR I = 1 TO N - 1
divisible by 13” END IF IF N MOD I = 0 THEN S = S + I
END IF END SUB NEXT I
END SUB PERFECT = S
END FUNCTION
https://seeqbasicomputer.blogspot.com/ 111 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
45.Write a sub program to find 46.Write a program to display only 47.Write a program to define a
whether the given number is perfect perfect square numbers between 1 to function procedure which returns
square number or not. 100 using SUB-END SUB. whether a input number is positive,
negative or zero using SGN function.
DECLARE SUB PERFECT (N) DECLARE SUB PERFECT ( ) DECLARE FUNCTION CHECK$ (N)
CLS CLS CLS
INPUT "ENTER ANY NUMBER"; N CALL PERFECT INPUT "Enter any number"; N
CALL PERFECT (N) END PRINT "The given number is ";
END SUB PERFECT () CHECK$(N)
SUB PERFECT (N) FOR N = 1 TO 100 END
S = SQR(N) S = SQR(N) FUNCTION CHECK$ (N)
IF S = INT(S) THEN IF S = INT(S) THEN PRINT N, S = SGN(N)
PRINT "PERFECT SQUARE" NEXT N SELECT CASE S
ELSE END SUB CASE 1
PRINT "NOT PERFECT SQUARE" CHECK$ = "positive number"
END IF CASE -1
END SUB CHECK$ = "negative number"
CASE 0
CHECK$ = "zero"
END SELECT
END FUNCTION
48.Write a program to input any 49.Write a program to input a year 50.Write a program to input any
number and display whether it is odd and display whether that year is a number and check whether the given
or even using function procedure. leap year or not. [divisible by 4 but no. is positive or negative using sub
not 100] using sub procedure. procedure.
DECLARE FUNCTION CHECK$ (N)
CLS DECLARE SUB CHECK (Y) DECLARE SUB CHECK (N)
INPUT “ENTER ANY NUMBER”; N CLS CLS
PRINT “THE GIVEN NUMBER IS “; INPUT “ENTER YEAR”; Y INPUT “ENTER ANY NUMBER”; N
CHECK$(N) CALL CHECK (Y) CALL CHECK (N)
END END END
SUB CHECK (Y) SUB CHECK (N)
FUNCTION CHECK$ (N) IF Y MOD 4 = 0 AND Y MOD 100 <> IF N > 0 THEN
IF N MOD 2 = 0 THEN 0 OR Y MOD 400 = 0 THEN PRINT “ POSITIVE NUMBER”
CHECK$ = “EVEN NUMBER” PRINT “LEAP YEAR” ELSEIF N < 0 THEN
ELSE ELSE PRINT “ NEGATIVE NUMBER”
CHECK$ = “ODD NUMBER” PRINT “NOT LEAP YEAR” END IF
END IF END IF END SUB
END FUNCTION END SUB
51.Input the age of a person and find 52.Input the age of a person and find 53.Write a program to enter any two
out whether the person is eligible to out whether the person can cast vote numbers and display the smaller one
drive or not using function or not using sub procedure. [age using function procedure.
procedure. [age >=16] >=18]
DECLARE FUNCTION SMALL (A,
DECLARE FUNCTION CHECK$ (A) DECLARE FUNCTION CHECK$ (A) B)
CLS CLS INPUT “ENTER ANY TWO
INPUT “ENTER YOUR AGE”; A INPUT “ENTER YOUR AGE”; A NUMBERS”; A, B
PRINT “YOU ARE “; CHECK$(A) PRINT “YOU ARE “; CHECK$(A) PRINT “THE SMALLER NUMBER
END END IS”; SMALL (A, B)
FUNCTION CHECK$ (A) FUNCTION CHECK$ (A) END
IF A >= 16 THEN IF A >= 18 THEN FUNCTION SMALL (A, B)
CHECK$ = “ELIGIBLE TO DRIVE” CHECK$ = “ELIGIBLE TO VOTE” IF A < B THEN
ELSE ELSE SMALL = A
CHECK$ = “ NOT ELIGIBLE TO CHECK$ = “ NOT ELIGIBLE TO ELSE
DRIVE” VOTE” SMALL = B
END IF END IF END IF
END FUNCTION END FUNCTION END FUNCTION
https://seeqbasicomputer.blogspot.com/ 112 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
54.Write a program to enter any three 55.Write a program to enter any three 56.Write a program to input three
numbers and display the smallest one numbers and display the middle different numbers in the main module
using function procedure. number using sub procedure. then find the greatest number using
SUB….END SUB.
DECLARE SUB SMALL (A, B, C) DECLARE SUB MIDDLE(A, B, C)
CLS CLS DECLARE FUNCTION GREAT (A, B,
INPUT “ENTER ANY THREE INPUT “ENTER ANY THREE C)
NUMBERS”; A, B, C NUMBERS”; A, B, C INPUT “ENTER ANY THREE
CALL SMALL (A, B, C) CALL MIDDLE (A, B, C) NUMBERS”; A, B, C
END END PRINT “THE GREATEST NUMBER
SUB SMALL (A, B, C) SUB MIDDLE (A, B, C) IS”; GREAT (A, B, C)
IF A < B AND A < C THEN IF A > B AND A < C OR A < B AND A END
S=A > C THEN FUNCTION GREAT (A, B, C)
ELSEIF B < A AND B < C THEN PRINT “THE MIDDLE NUMBER IS”; IF A > B AND A > C THEN
S=B A G=A
ELSE ELSEIF B > A AND B < C OR B < A ELSEIF B > A AND B > C THEN
S=C AND B > C THEN G=B
END IF PRINT “THE MIDDLE NUMBER IS”; ELSE
PRINT “THE SMALLEST NUMBER IS B G=C
“; S ELSE END IF
END SUB PRINT “THE MIDDLE NUMBER IS”; GREAT = G
C END FUNCTION
END IF
END SUB
57.Write a sub program to input 20 58.Write a sub program to input three 59.Write a function program to input
different numbers in an array variable sides of a triangle and determine three sides of a triangle and determine
and find the largest and smallest whether a triangle can be formed or whether a triangle is right angled
number not. triangle or not.
DECLARE SUB GREAT ( ) DECLARE SUB CHECK (A, B, C) DECLARE FUNCTION CHECK$ (H,
DECLARE SUB SMALL ( ) CLS B, P)
DIM SHARED N(20) INPUT “ENTER THREE SIDES OF A CLS
CLS TRIANGLE”; A,B,C INPUT “ENTER HEIGHT, BASE AND
FOR I = 1 TO 20 CALL CHECK (A, B, C) PERPENDICULAR”; H, B, P
INPUT "ENTER THE NUMBERS"; END PRINT CHECK$ (H, B, P)
N(I) END
NEXT I SUB CHECK (A, B, C)
CALL GREAT IF (A + B) > C AND (B + C) > A AND FUNCTION CHECK$ (H, B, P)
CALL SMALL (A + C) > B THEN IF H ^ 2 = (B ^ 2 + P ^ 2) THEN
END PRINT “THE TRIANGLE CAN BE CHECK$ = “IT IS A RIGHT ANGLED
FORMED” TRIANGLE”
SUB GREAT ELSE ELSE
G = N(1) PRINT “THE TRIANGLE CANNOT CHECK$ = “IT IS NOT A RIGHT
FOR I = 2 TO 20 BE FORMED” ANGLED TRIANGLE”
IF N(I) > G THEN G = N(I) END IF END IF
NEXT I END SUB END FUNCTION
PRINT "GREATEST NUMBER"; G
END SUB
SUB SMALL
S = N(1)
FOR I = 2 TO 20
IF N(I) < S THEN S = N(I)
NEXT I
PRINT "SMALLEST NUMBER"; S
END SUB
https://seeqbasicomputer.blogspot.com/ 113 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
60.Write a sub program to input three 61.WAP to print the sum of the digits 62.Write a program to enter a number
sides of a triangle and determine of a given numbers using SUB and find the product of its digits using
whether a triangle is equilateral, Procedure. FUNCTION procedure.
isosceles or scalene triangle or not.
DECLARE SUB CHECK (A, B, C) DECLARE SUB SUM (N) DECLARE FUNCTION PROD (N)
INPUT “ENTER THREE SIDES OF A CLS CLS
TRIANGLE”; A,B,C INPUT "ENTER ANY NUMBER"; N INPUT "ENTER ANY NUMBER"; N
CALL CHECK (A, B, C) CALL SUM (N) PR = PROD (N)
END END PRINT "PRODUCT OF DIGITS"; PR
SUB CHECK (A, B, C) SUB SUM (N) END
IF A = B AND B = C THEN S=0
PRINT “IT IS A EQUILATERAL WHILE N < > 0 FUNCTION PROD (N)
TRIANGLE” R = N MOD 10 P=1
ELSEIF A = B OR B = C OR C = A S=S+R WHILE N < > 0
THEN N = N \ 10 R = N MOD 10
PRINT “IT IS ISOSCELES WEND P=P*R
TRIANGLE” PRINT "SUM OF DIGITS"; S N = N \ 10
ELSEIF A < > B AND B < > C THEN END SUB WEND
PRINT “ IT IS A SCALENE PROD = P
TRIANGLE” END FUNCTION
END IF
END SUB
63.Write a sub program to input 64.Write a sub program to input 65.Write a function program to input
number and find sum of even digits. number and count total no. of digits. number and display only odd digits.
DECLARE SUB SUMEVEN (N) DECLARE SUB COUNT (N) DECLARE FUNCTION ODD (N)
CLS CLS REM
INPUT "ENTER ANY NUMBER"; N INPUT "ENTER ANY NUMBER"; N CLS
CALL SUMEVEN (N) CALL COUNT (N) INPUT "ENTER ANY NUMBER"; N
END END PRINT " ODD DIGITS ARE ";
SUB SUMEVEN (N) SUB COUNT (N) D = ODD(N)
S=0 C=0 END
WHILE N < > 0 WHILE N < > 0 FUNCTION ODD (N)
R = N MOD 10 C=C+1 WHILE N <> 0
IF R MOD 2 = 0 THEN S = S + R N = N \ 10 R = N MOD 10
N = N \ 10 WEND IF R MOD 2 = 1 THEN PRINT R;
WEND PRINT "TOTAL NUMBER OF N = N \ 10
PRINT "SUM OF EVEN DIGITS"; S DIGITS"; C WEND
END SUB END SUB END FUNCTION
66.Write a program using FUNCTION 67.Write a sub program to input any 68.Write a sub program to display first
procedure to reverse and display the number and check whether the given no. 20 palindrome numbers.
integer number having more than one is palindrome or not. DECLARE SUB PALIN ( )
digit passed as arguments from the main DECLARE SUB PALIN (N) CLS
module. [Hint: 123 is reversed as 321]. CLS CALL PALIN
DECLARE FUNCTION REV (N) INPUT "ENTER ANY NUMBER"; N END
CLS CALL PALIN (N) SUB PALIN
INPUT "ENTER ANY NUMBER"; N END N=1
PRINT " REVERSED DIGITS="; REV SUB PALIN (N) CNT = 1
(N) A=N TOP:
END S=0 A=N:S=0
FUNCTION REV (N) WHILE N < > 0 WHILE A < > 0
S=0 R = N MOD 10 R = A MOD 10
WHILE N < > 0 S = S * 10 + R S = S * 10 + R
R = N MOD 10 N = N \ 10 A = A \ 10
S = S * 10 + R WEND WEND
N = N \ 10 IF A = S THEN IF N = S THEN
WEND PRINT A; "IS PALINDROME" PRINT N,
REV = S ELSE CNT = CNT + 1
END FUNCTION PRINT A; "IS NOT PALINDROME" END IF
END IF N=N+1
END SUB IF CNT <= 20 THEN GOTO TOP
END SUB
https://seeqbasicomputer.blogspot.com/ 114 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
69.Write a sub program to display all 70.Write a function program to input any 71.Write a sub program to display first 5
palindrome numbers from 1 to 200. number and check whether the given no. is Armstrong numbers.
DECLARE SUB PALIN ( ) Armstrong or not. DECLARE SUB ARM ( )
CLS DECLARE FUNCTION ARM (N) CLS
CALL PALIN INPUT "ENTER ANY NUMBER"; N CALL ARM
END A=N END
SUB PALIN AR = ARM (N) SUB ARM
N=1 IF A = AR THEN N = 1 : CNT = 1
FOR I = 1 TO 200 PRINT A; "IS ARMSTRONG NUMBER" TOP:
A=N ELSE A=N
S=0 PRINT A; "IS NOT ARMSTRONG S=0
WHILE A < > 0 NUMBER" WHILE A < > 0
R = A MOD 10 END IF R = A MOD 10
S = S * 10 + R END S=S+R^3
A = A \ 10 FUNCTION ARM (N) A = A \ 10
WEND S=0 WEND
IF N = S THEN PRINT N, WHILE N < > 0 IF N = S THEN
N=N+1 R = N MOD 10 PRINT N,
NEXT I S=S+R^3 CNT = CNT + 1
END SUB N = N \ 10 END IF
WEND N=N+1
ARM = S IF CNT <= 5 THEN GOTO TOP
END FUNCTION END SUB
72.Write a sub program to display all 73.Write a function program to input 74.Write a sub program to display all
Armstrong numbers from 1 to 500. number and check whether the given prime numbers from 1 to 100.
DECLARE SUB ARM ( ) no. is prime or composite.
CLS DECLARE FUNCTION PRIME(N) DECLARE SUB PRIME ( )
CALL ARM CLS CLS
END INPUT "ENTER ANY NUMBER"; N CALL PRIME
SUB ARM P = PRIME (N) END
N=1 IF P = 2 THEN
FOR I = 1 TO 500 PRINT N; "IS PRIME NUMBER" SUB PRIME
A=N ELSE FOR N = 1 TO 100
S=0 PRINT N; "IS COMPOSITE NUMBER" C=0
WHILE A <> 0 END IF FOR I = 1 TO N
R = A MOD 10 END IF N MOD I = 0 THEN C = C + 1
S=S+R^3 FUNCTION PRIME (N) NEXT I
A = A \ 10 C=0 IF C = 2 THEN PRINT N,
WEND FOR I = 1 TO N NEXT N
IF N = S THEN PRINT N, IF N MOD I = 0 THEN C = C + 1 END SUB
N=N+1 NEXT I
NEXT I PRIME = C
END SUB END FUNCTION
75.Write a sub program to display first 76.Write a sub program to input 77.Write a sub program to input any
20 prime numbers. number and check whether the given number and display the factors.
DECLARE SUB PRIME ( ) no. Composite or not.
CALL PRIME DECLARE SUB COMPOSITE (N) DECLARE SUB FACT (N)
END INPUT "ENTER ANY NUMBER"; N CLS
SUB PRIME CALL COMPOSITE (N) INPUT "ENTER ANY NUMBER"; N
N=1 END CALL FACT (N)
CNT = 1 SUB COMPOSITE (N) END
TOP: C=0
C=0 FOR I = 1 TO N SUB FACT (N)
FOR I = 1 TO N IF N MOD I = 0 THEN C = C + 1 PRINT "FACTORS OF"; N; "=";
IF N MOD I = 0 THEN C = C + 1 NEXT I FOR I = 1 TO N
NEXT I IF C < > 2 THEN IF N MOD I = 0 THEN PRINT I;
IF C = 2 THEN PRINT N; "IS COMPOSITE NUMBER" NEXT I
PRINT N, ELSE END SUB
CNT = CNT + 1 PRINT N; "IS NOT COMPOSITE
END IF NUMBER"
N=N+1 END IF
IF CNT <= 20 THEN GOTO TOP END SUB
END SUB
https://seeqbasicomputer.blogspot.com/ 115 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
78.Write a program source code 79.Write a program using a SUB 80.Write a program in QBASIC to
using FUNCTION.....END procedure module to print the input any two different number and
FUNCTION to calculate the factorial multiplication table of any input print HCF and LCM using
of an input number. number up to tenth terms. [SEE 2075 SUB………END SUB
DECLARE FUNCTION FACT (N) S2] DECLARE SUB HCF(A, B)
CLS DECLARE SUB MUL (N) CLS
INPUT "ENTER ANY NUMBER"; N CLS INPUT "ENTER ANY TWO
PRINT "FACTORIAL ="; FACT (N) INPUT "ENTER ANY NUMBER"; N NUMBERS"; A, B
END CALL MUL (N) CALL HCF (A, B)
END END
FUNCTION FACT (N)
F=1 SUB MUL (N) SUB HCF (A, B)
FOR I = 1 TO N FOR I = 1 TO 10 WHILE A MOD B < > 0
F=F*I PRINT N; "X"; I; "="; N * I T = A MOD B
NEXT I NEXT I A=B
FACT = F END SUB B=T
END FUNCTION WEND
PRINT "H.C.F="; B
END SUB
81.Write a program in QBASIC to 82.Write a program using sub 83.Write a program to display 33333,
display the following series using procedure to print series: 1, 11, 111, 3333, 333, 33, 3 by using
SUB…. END SUB. 1111, 11111 SUB........END SUB
5, 55, 555 ….. up to 6th terms
DECLARE SUB SERIES ( ) DECLARE SUB SERIES ( ) DECLARE SUB SERIES ( )
CLS CLS CLS
CALL SERIES CALL SERIES CALL SERIES
END END END
SUB SERIES SUB SERIES SUB SERIES
A=5 A=1 A = 33333
FOR I = 1 TO 5 FOR I = 1 TO 5 FOR I = 1 TO 5
PRINT A, PRINT A, PRINT A
A = A * 10 + 5 A = A * 10 + 1 A = A \ 10
NEXT I NEXT I NEXT I
END SUB END SUB END SUB
84.Write a sub procedure to display 85.Write a sub procedure to display 86.Write a sub procedure to display
1, 12, 123, 1234, 12345 1, 22, 333, 4444, 55555 12345, 1234, 123, 12, 1
DECLARE SUB SERIES ( ) DECLARE SUB SERIES ( ) DECLARE SUB DISP( )
CLS CLS CLS
CALL SERIES CALL SERIES CALL DISP
END END END
SUB SERIES SUB SERIES SUB DISP ( )
FOR I = 1 TO 5 FOR I = 1 TO 5 FOR I = 5 TO 1 STEP -1
FOR J = 1 TO I FOR J = 1 TO I FOR J = 1 TO I
PRINT J; PRINT I; PRINT J;
NEXT J NEXT J NEXT J
PRINT PRINT PRINT
NEXT I NEXT I NEXT I
END SUB END SUB END SUB
87.Write a sub procedure to display 88.Write a sub procedure to display 89.Write a sub procedure to display 5, 54,
55555, 4444, 333, 22, 1 54321, 5432, 543, 54, 5 543, 5432, 54321
DECLARE SUB SERIES ( ) DECLARE SUB SERIES ( ) DECLARE SUB SERIES ()
CLS CLS CLS
CALL SERIES CALL SERIES CALL SERIES
END END END
SUB SERIES SUB SERIES SUB SERIES
FOR I = 5 TO 1 STEP -1 FOR I = 5 TO 1 STEP -1 FOR I = 5 TO 1 STEP -1
FOR J = 1 TO I FOR J = I TO 1 STEP -1 FOR J = 5 TO I STEP -1
PRINT I; PRINT J; PRINT J;
NEXT J NEXT J NEXT J
PRINT PRINT PRINT
NEXT I NEXT I NEXT I
END SUB END SUB END SUB
https://seeqbasicomputer.blogspot.com/ 116 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
90.Write a Qbasic Program to 91.Write a sub procedure to display: 92.Write a sub procedure to display
generate 1800, 1600, 1400, ……..10 th 1, 121, 12321, 1234321, 123454321 123454321, 1234321, 12321, 121, 1
term. DECLARE SUB SERIES ( ) DECLARE SUB SERIES ()
DECLARE SUB DISP( ) CLS CLS
CLS CALL SERIES CALL SERIES
CALL DISP END END
END SUB SERIES SUB SERIES
SUB DISP ( ) A# = 1 A# = 11111
A = 1800 FOR I = 1 TO 5 FOR I = 1 TO 5
FOR I = 1 TO 10 PRINT A# ^ 2 PRINT A# ^ 2
PRINT A A# = A# * 10 + 1 A# = A# \10
A = A - 200 NEXT I NEXT I
NEXT I END SUB END SUB
END SUB
93.Write a sub program to generate 94.Write a sub procedure to generate 95.Write a sub procedure to generate
9,28,14,7,22,11…………..10th term 7,22,11,34……………10th terms. 22,11,34,17,52,26,13,40,20,10
DECLARE SUB SERIES ( ) DECLARE SUB SERIES ( ) DECLARE SUB SERIES ( )
CLS CLS CLS
CALL SERIES CALL SERIES CALL SERIES
END END END
SUB SERIES
A=9 SUB SERIES SUB SERIES
FOR I = 1 TO 10 A=7 A = 22
PRINT A; FOR I = 1 TO 10 FOR I = 1 TO 10
IF A MOD 2 = 0 THEN PRINT A; PRINT A;
A=A\2 IF A MOD 2 = 0 THEN IF A MOD 2 = 0 THEN
ELSE A=A\2 A=A\2
A=A*3+1 ELSE ELSE
END IF A=A*3+1 A=A*3+1
NEXT I END IF END IF
END SUB NEXT I NEXT I
END SUB END SUB
96.Write a program to print the following 97.Write a program to print 1, 8, 27, 98.Write a display the following series:
series by using SUB ……END SUB: 1, 4, 64.....upto 10th term. 999, 728, 511.........upto 10th term.
9, 16.....upto 10th term. DECLARE SUB SERIES ( )
DECLARE SUB SERIES ( ) CLS
DECLARE SUB SERIES () CLS CALL SERIES
CLS CALL SERIES END
CALL SERIES END SUB SERIES
END a = 999
SUB SERIES b = 271
SUB SERIES FOR I = 1 TO 9 c = 54
FOR I = 1 TO 9 PRINT I ^ 3 FOR i = 1 TO 10
PRINT I ^ 2 NEXT I PRINT a
NEXT I END SUB a=a-b
END SUB b=b-c
c=c-6
NEXT i
END SUB
99.Write a program to display 315, 270, 100.Write a program to display 5, 10, 20, 101.Write a program to print the
215, 150 ........ upto 10th term. 35, 55.........upto 10th term. following series 2, 8, 18, 32, 10th terms
DECLARE SUB SERIES ( ) DECLARE SUB DISP( ) using SUB ……………. END SUB
CLS CLS DECLARE SUB DISP( )
CALL SERIES CALL DISP CLS
END END CALL DISP
SUB SERIES SUB DISP () END
a = 315 A=5 SUB DISP ( )
b = 45 B=5 A=2
FOR i = 1 TO 10 FOR I = 1 TO 10 B=6
PRINT a PRINT A FOR I = 1 TO 10
a=a-b A=A+B PRINT A
b = b + 10 B=B+5 A=A+B
NEXT i NEXT I B=B+4
END SUB END SUB NEXT I
END SUB
https://seeqbasicomputer.blogspot.com/ 117 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
102.Write a program to display 2 , 4, 103.Write a program to display 2, 4, 7, 104.Write a program to display
8, 14, 22 …upto 10th terms 11, 16 up to 10th terms. 2,6,12,20,30 …..up to 10th term
DECLARE SUB DISP( ) DECLARE SUB DISP( ) DECLARE SUB DISP( )
CLS CLS CLS
CALL DISP CALL DISP CALL DISP
END END END
SUB DISP ( ) SUB DISP ( ) SUB DISP ( )
A=2 A=2 A=2
B=2 B=2 B=4
FOR I = 1 TO 10 FOR I = 1 TO 10 FOR I = 1 TO 10
PRINT A PRINT A PRINT A
A=A+B A=A+B A=A+B
B=B+2 B=B+1 B=B+2
NEXT I NEXT I NEXT I
END SUB END SUB END SUB
105.Write a program to display 0,1, 3, 106.Write a program to display 1, 2, 4, 107.Write a program display : 2, 8, 18,
6, 10, 15 up to 20th terms. 7, 11 up to 10th term. 32..........upto 10 terms.
DECLARE SUB DISP( ) DECLARE SUB DISP( ) DECLARE SUB DISP( )
CLS CLS CLS
CALL DISP CALL DISP CALL DISP
END END END
SUB DISP ( ) SUB DISP ( ) SUB DISP ( )
A=0 A=1 FOR I = 1 TO 10
B=1 B=1 PRINT I ^ 2 * 2
FOR I = 1 TO 20 FOR I = 1 TO 10 NEXT I
PRINT A PRINT A END SUB
A=A+B A=A+B
B=B+1 B=B+1
NEXT I NEXT I
END SUB END SUB
108.Write a program to display 109.Write a program to display 5, 10, 110.Write a program to display: 1, 0, 1,
1,2,3,5,8……………….13th terms. 15, 25, 40, 65, 105 ......up to 10th term 1, 2, 3................... upto 10 th term.
DECLARE SUB SERIES ( ) DECLARE SUB SERIES ( ) DECLARE SUB SERIES ( )
CLS CLS CLS
CALL SERIES CALL SERIES CALL SERIES
END END END
https://seeqbasicomputer.blogspot.com/ 118 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
114.Write a sub program to display 115.Write a sub program to display 116.Write a program to print the
numbers 2, 4, 6, ............20. numbers 100, 90, 80, .................10 following serial 9, 7, 5,……1
https://seeqbasicomputer.blogspot.com/ 119 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
126.Write a program using FUNCTION to get a word from 127.Write a program to test whether the input word is
the user and print the word in the reverse order. palindrome word or not using FUNCTION…………END
FUNCTION.
DECLARE FUNCTION REV$ (S$)
CLS DECLARE FUNCTION REV$ (S$)
INPUT "ENTER ANY STRING"; S$ CLS
PRINT "REVERSED STRING IS "; REV$(S$) INPUT "ENTER ANY STRING"; S$
END C$ = REV$(S$)
IF S$ = C$ THEN
FUNCTION REV$ (S$) PRINT “THE GIVEN STRING IS PALINDROME”
FOR I = LEN(S$) TO 1 STEP -1 ELSE
B$ = MID$(S$, I, 1) PRINT “THE GIVEN STRING IS NOT PALINDROME”
W$ = W$ + B$ END IF
NEXT I END
REV$ = W$
END FUNCTION FUNCTION REV$ (S$)
FOR I = LEN(S$) TO 1 STEP -1
B$ = MID$(S$, I, 1)
W$ = W$ + B$
NEXT I
REV$ = W$
END FUNCTION
128.Write a program to print the shortest word among the 129.Write a function program to enter any ten strings and
three different word input by the user using display the shortest string.
FUNCTION…….END FUNCTION.
DECLARE FUNCTION SHRT$( A$, B$, C$) DECLARE FUNCTION SHRT$( A$ )
CLS CLS
INPUT "ENTER FIRST STRING"; A$ INPUT "ENTER FIRST STRING"; A$
INPUT "ENTER SECOND STRING"; B$ PRINT "SHORTEST STRING="; SHRT$(A$)
INPUT "ENTER THIRD STRING"; C$ END
PRINT "SHORTEST STRING="; SHRT$( A$, B$, C$) FUNCTION SHRT$(A$)
END FOR I = 2 TO 10
FUNCTION SHRT$( A$, B$, C$) INPUT "ENTER NEXT STRING"; B$
IF LEN(A$) < LEN(B$) AND LEN(A$) < LEN(C$) THEN IF LEN(B$) < LEN(A$) THEN A$ = B$
S$ = A$ NEXT I
IF LEN(B$) < LEN(A$) AND LEN(B$) < LEN(C$) THEN SHRT$ = A$
S$ = B$ END FUNCTION
ELSE
S$ = C$
END IF
SHRT$ = S$
END FUNCTION
130.Write a program using FUNCTION….END 131.Write a program to find the numbers of vowels in an
FUNCTION to input a string and count the total number of input string using ‘SUB…..END SUB’.
consonants. DECLARE SUB COUNT (S$)
DECLARE FUNCTION COUNT (S$) CLS
CLS INPUT "ENTER ANY STRING"; S$
INPUT "ENTER ANY STRING"; S$ CALL COUNT(S$)
PRINT "TOTAL NO. OF CONSONANTS= "; COUNT(S$) END
END
FUNCTION COUNT (S$) SUB COUNT (S$)
CC = 0 VC = 0
FOR I = 1 TO LEN(S$) FOR I = 1 TO LEN(S$)
B$ = MID$(S$, I, 1) B$ = MID$(S$, I, 1)
C$ = UCASE$(B$) C$ = UCASE$(B$)
IF C$ <> "A" AND C$ <> "E" AND C$ <> "I" AND C$ <> IF C$ = "A" OR C$ = "E" OR C$ = "I" OR C$ = "O" OR C$ =
"O" AND C$ <> "U" THEN CC = CC + 1 "U" THEN VC = VC + 1
NEXT I NEXT I
COUNT = CC PRINT "TOTAL NO. OF VOWELS= "; VC
END FUNCTION END SUB
https://seeqbasicomputer.blogspot.com/ 120 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
132.Write a program using FUNCTION... END 133.Write a program to declare SUB procedure to print
FUNCTION to count the number of words in a sentence. only the vowels from a given word.
136.Write a function program to enter a string and then 137.Write a sub program to input any string and display
find out the sum of even ASCII value of each characters. only consonant by removing vowels.
DECLARE FUNCTION DISP$ (S$)
DECLARE FUNCTION SUM(A$) CLS
CLS INPUT "ENTER ANY STRING"; S$
INPUT "ENTER ANY STRING"; A$ PRINT DISP(S$)
PRINT " SUM OF EVEN ASCII VALUE="; SUM(A$) END
END
FUNCTION SUM (A$) FUNCTION DISP$ (S$)
FOR I = 1 TO LEN(A$) FOR I = 1 TO LEN(S$)
B$ = MID$(A$, I, 1) B$ = MID$(S$, I, 1)
C = ASC(B$) C$ = UCASE$(B$)
IF C MOD 2 = 0 THEN S = S + C IF C$ <> "A" AND C$ <> "E" AND C$ <> "I" AND C$ <>
NEXT I "O" AND C$ <> "U" AND C$ <> " " THEN W$=W$+B$
SUM=S END IF
NEXT I
END FUNCTION DISP$ = W$
END FUNCTION
https://seeqbasicomputer.blogspot.com/ 121 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
138.Write a program to enter a long string and display only 139.Write a program using SUB……….END SUB to
initial character of each word Using function procedure. display:
DECLARE FUNCTION INIT$(A$) N
CLS E
INPUT "ENTER ANY STRING"; A$ P
PRINT INIT$(A$) A
END L
FUNCTION INIT$ (A$) DECLARE SUB PATTERN (S$)
C$ = LEFT$(A$, 1) S$ = "NEPAL"
FOR I = 1 TO LEN(A$) CALL PATTERN(S$)
B$ = MID$(A$, I, 1) END
IF B$ = " " THEN C$ = C$ + MID$(A$, I + 1, 1) SUB PATTERN (S$)
NEXT I FOR I = 1 TO LEN(S$)
INIT$ = C$ PRINT MID$(S$, I, 1)
END FUNCTION NEXT I
END SUB
140.Write a program to display the following pattern: - 141.Write a program using SUB..........END SUB to display
H -
KHA NEPAL
OKHAR NEPA
POKHARA NEP
DECLARE SUB PATTERN (S$) NE
S$ = "POKHARA" N
CALL PATTERN(S$) DECLARE SUB PATTERN (S$)
END S$ = "NEPAL"
SUB PATTERN (S$) CALL PATTERN(S$)
A=4 END
FOR I = 1 TO LEN(S$) STEP 2 SUB PATTERN (S$)
PRINT TAB(A); MID$(S$, A, I) FOR I = LEN(S$) TO 1 STEP - 1
A=A-1 PRINT LEFT$(S$, I)
NEXT I NEXT I
END SUB END SUB
142.Write a program using SUB……….END SUB to display. 143.Write a sub to print the following pattern:
N NEPAL
NE EPAL
NEP PAL
NEPA AL
NEPAL L
DECLARE SUB PATTERN (S$) DECLARE SUB PATTERN (S$)
CLS CLS
S$ = "NEPAL" S$ = "NEPAL"
CALL PATTERN(S$) CALL PATTERN(S$)
END END
SUB PATTERN (S$) SUB PATTERN (S$)
FOR I = 1 TO LEN(S$) FOR I = LEN(S$) TO 1 STEP - 1
PRINT LEFT$(S$, I) PRINT RIGHT$(S$, I)
NEXT I NEXT I
END SUB END SUB
144.Write a SUB procedure to generate given below: 145.Print following pattern
EVEREST
VERES *
ERE ***
R *****
DECLARE SUB PATTERN (S$) *******
S$ = "EVEREST" DECLARE SUB PATTERN (S$)
CALL PATTERN(S$) CLS
END S$ = "*******"
SUB PATTERN (S$) CALL PATTERN(S$)
A=1 END
FOR I = LEN(S$) TO 1 STEP -2 SUB PATTERN (S$)
PRINT TAB(A); MID$(S$, A, I) FOR I = 1 TO LEN(S$) STEP 2
A=A+1 PRINT LEFT$(S$, I)
NEXT I NEXT I
END SUB END SUB
https://seeqbasicomputer.blogspot.com/ 122 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
146.Write a program to store Roll no., Name, Class and 147.A sequential data file called “student.dat” contains
Address of any five students. [SEE 2074] same records under the field’s name, english, nepali and
OPEN "Student.dat" FOR OUTPUT AS #1 computer. Write a program to add some more records in
FOR I = 1 TO 5 the same sequential data file. [SLC 2068]
INPUT "Enter Roll No."; r OPEN “student.dat” FOR APPEND AS #1
INPUT "Enter Name"; n$ DO
INPUT "Enter Class"; c CLS
INPUT "Enter Address"; a$ INPUT “ENTER NAME”; N$
WRITE #1, r, n$, c, a$ INPUT “ENTER MARKS IN ENGLISH”; E
NEXT I INPUT “ENTER MARKS IN NEPALI”; N
CLOSE #1 INPUT “ENTER MARKS IN COMPUTER”; C
END WRITE #1, N$, E, N, C
INPUT “DO YOU WANT TO CONTINUE”; CH$
LOOP WHILE UCASE$(CH$) = “Y”
CLOSE #1
END
148.A sequential data file “RECORD.DAT” and store 149.Create a data file to store the records of few employees
Name, Address and Salary of employees. WAP to add some having Name, Address, Post, Gender and Salary fields.
more records in the data file “RECODR.DAT”. Program [SEE 2073]
should terminate with user choice. OPEN “std.rec” FOR OUTPUT AS #1
OPEN “RECORD.DAT” FOR APPEND AS #1 TOP:
DO CLS
CLS INPUT “Enter Name”; N$
INPUT “ENTER NAME”; N$ INPUT “Enter Address”; A$
INPUT “ENTER MARKS IN ENGLISH”; E INPUT “Enter Post”; P$
INPUT “ENTER MARKS IN NEPALI”; N INPUT “Enter gender”; G$
INPUT “ENTER MARKS IN COMPUTER”; C INPUT “Enter Salary”; S
WRITE #1, N$, E, N, C WRITE #1, N$, A$, P$, G$, S
INPUT “DO YOU WANT TO CONTINUE”; CH$ INPUT “Do you want to continue”; CH$
LOOP WHILE UCASE$(CH$) = “Y” IF UCASE$(CH$)=”Y” THEN GOTO TOP
CLOSE #1 CLOSE #1
END END
150.Create a sequential data file ’Price.dat’ to store item name, 151.Create a sequential data file’post.dat’ to store name and
quantity and Rate also calculate total amount(total=Quantity X marks of any three subjects also calculate total and percentages
Rate).Program should terminate according to the user’s choice. only for 15 students.
OPEN “price.dat” FOR OUTPUT AS #1 OPEN "post.dat" FOR OUTPUT AS #1
TOP: FOR I = 1 TO 15
CLS INPUT "Enter Name"; n$
INPUT “Enter Item Name”; N$ INPUT "Enter marks in any three subjects”; A, B, C
INPUT “Enter Quantity”; Q T=A+B+C
INPUT “Enter Rate”; R P=T/3
T=Q*R WRITE #1, n$, A, B, C, T, P
WRITE #1, N$, Q, R, T NEXT I
INPUT “Do you want to continue”; CH$ CLOSE #1
IF CH$=”Y” OR CH$ = “y” THEN GOTO TOP END
CLOSE #1
END
152.Store SIDNO, name, address and Telephone number of five 153.A sequential data file “Address.inf” contains serial no, name,
students and display the records on monitor in sequential data file address, telephone and email_id.WAP to record as many records as
“STDINFO” the user wants. The serial number should be generated automatically
OPEN "STDINFO.DAT" FOR OUTPUT AS #1 like 5001,5003,5005.
FOR I = 1 TO 5 OPEN " Address.inf " FOR OUTPUT AS #1
INPUT "ENTER NAME"; N$ DO
INPUT "ENTER ADDRESS"; A$ CLS
INPUT "ENTER TELEPHONE"; T# C = 5001
WRITE #1, N$, A$, T# INPUT “ENTER NAME”; N$
NEXT I INPUT “ENTER ADDRESS”; A$
CLOSE #1 INPUT “ENTER TELEPHONE”; T#
OPEN "STDINFO.DAT" FOR INPUT AS #1 INPUT “ENTER EMAIL”; E$
CLS WRITE #1, C, N$, A$, T$, E$
FOR I = 1 TO 5 C=C+2
INPUT #1, N$, A$, T# INPUT “DO YOU WANT TO CONTINUE (Y / N)”; CH$
PRINT N$, A$, T# LOOP WHILE UCASE$(CH$) = “Y”
NEXT I CLOSE #1
CLOSE #1 END
END
https://seeqbasicomputer.blogspot.com/ 123 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
154.A Sequential data file called "SEE.DAT" has stored data under 155.A sequential data file “STD.TXT” contains name and marks in
the field heading Symbol No., Name, English, Nepali, and Computer. three different subjects of some students. Write a program to display
Write a program to display all the information of those students whose only fail student’s records assuming pass marks 40.
marks in Computer is more than 80. OPEN "STD.TXT" FOR INPUT AS #1
OPEN "SEE.DAT" FOR INPUT AS #1 CLS
CLS WHILE NOT EOF (1)
WHILE NOT EOF (1) INPUT #1, B$, C, D, E
INPUT #1, A, B$, C, D, E IF C < 40 AND D <40 AND E <40 THEN PRINT B$, C, D, E
IF E > 80 THEN PRINT A, B$, C, D, E WEND
WEND CLOSE #1
CLOSE #1 END
END
156.Write a program which reads records from the file ”Result.DAT” 157.Write a program to read all the records from the data file
having the fields name, and marks of three different subjects and “STUDENT.TXT” and display all the records where the fields name
display only those records whose percentage is greater than 60 and are unknown.
less than 80. Also count the total number of records presenting in that
data files. OPEN "STUDENT.TXT" FOR INPUT AS #1
OPEN "STD.TXT" FOR INPUT AS #1 CLS
CLS WHILE NOT EOF (1)
WHILE NOT EOF (1) LINE INPUT #1, A$
INPUT #1, B$, C, D, E PRINT A$
A=A+1 WEND
T=C+D+E CLOSE #1
P=T/3 END
IF P > 60 AND P < 80 THEN PRINT B$, C, D, E
WEND
PRINT “TOTAL NO. OF RECORDS=”; A
CLOSE #1
END
158.A data file "pabson.txt" contains the records composed 159.A data file “INFO.DAT” has numerous records in it
of the fields like school, principal, address, contact. Write a with name, address age, and telephone numbers in it. Write
program in Qbasic to display records of the schools located a program to read all the records and print those with
in either Kathmandu or Palpa address “NEPAL” and age >15
OPEN "PABSON.TXT" FOR INPUT AS #1 OPEN "INFO.DAT" FOR INPUT AS #1
CLS CLS
WHILE NOT EOF (1) WHILE NOT EOF (1)
INPUT #1, A$, B$, C$, D INPUT #1, A$, B$, C, D
IF UCASE$(C$) = “KATHMANDU” OR UCASE$(C$) = IF UCASE$(B$) = “NEPAL” AND C >15 THEN PRINT A$, B$,
“PALPA” THEN PRINT A$, B$, C$, D C, D
WEND WEND
CLOSE #1 CLOSE #1
END END
160.A sequential data file called 'ADDRESS.DAT' contains 161.A data file “lib.txt” consists of book’s name, author’s
NAME, AGE, CITY and TELEPHONE fields. Write a name and price of books. Write a program to count and
program to display all the contents of that data file. display the total number of records present in the file.
OPEN "ADDRESS.DAT" FOR INPUT AS #1 OPEN "LIB.TXT" FOR INPUT AS #1
CLS CLS
WHILE NOT EOF (1) WHILE NOT EOF (1)
INPUT #1, A$, B, C$, D INPUT #1, A$, B$, C
PRINT A$, B, C$, D D=D+1
WEND WEND
CLOSE #1 PRINT “TOTAL NUMBER OF RECORDS=”; D
END CLOSE #1
END
162.Write a program in QBASIC to open a sequential data file 163.A sequential data file named “nabil.txt” contains record of
“EMP.DAT”, which contains employees records: Name, address clients of a bank including depositor’s name, deposited amount,
and phone number and display all the records as well as total time and rate of interest. Wap to display detail of all depositors
number of records stored in the file. including simple interest.
OPEN "LIB.TXT" FOR INPUT AS #1 OPEN "NABIL.TXT" FOR INPUT AS #1
CLS CLS
WHILE NOT EOF (1) WHILE NOT EOF (1)
INPUT #1, A$, B$, C INPUT #1, N$, P, T, R
PRINT A$, B$, C I=P*T*R/100
D=D+1 PRINT A$, B$, C, I
WEND WEND
PRINT “TOTAL NUMBER OF RECORDS=”; D CLOSE #1
CLOSE #1 END
END
https://seeqbasicomputer.blogspot.com/ 124 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
164.A sequential data file “SALARY.DAT” contains the 165.A data file name “EMP.DAT”, contains number of
information, Employee-Code, Employee-Name, Post, Basic- records having fields name, post and salary. Write a
Salary. Write a program to display those records whose program to count total number of “Manager” in the data
Basic-salary is between 10000 to 15000 and Post is file. (hint: Manager is a post)
‘OFFICER’. OPEN "EMP.DAT" FOR INPUT AS #1
OPEN "SALARY.DAT" FOR INPUT AS #1 CLS
CLS WHILE NOT EOF (1)
WHILE NOT EOF (1) INPUT #1, N$, P$, S
INPUT #1, E,, N$, P$, S IF UCASE$(P$) = “MANAGER” THEN PRINT C = C + 1
IF UCASE$(P$) = “OFFICER” AND S >= 10000 AND S>= 15000 WEND
THEN PRINT A$, B$, C, D PRINT “TOTAL NO.OF MANAGERS ARE”; C
WEND CLOSE #1
CLOSE #1 END
END
166.A sequential data file “emp.dat” contains name, post 167.A data file “Salary.Dat” contains the information of
and salary fields of information about employees. Write a employee regarding their name, post and salary. Write a
program to display all the information of employees along program to display all the information of employee whose
with tax amount (also tax is 15% of salary). salary is greater than 15000 and less than 40000.
OPEN "EMP.DAT" FOR INPUT AS #1 OPEN "EMP.DAT" FOR INPUT AS #1
CLS CLS
WHILE NOT EOF (1) WHILE NOT EOF (1)
INPUT #1, N$, P$, S INPUT #1, N$, P$, S
T = 15 / 100 * S IF S >= 15000 AND S <= 40000 THEN PRINT N$, P$, S
PRINT N$, P$, S, T WEND
WEND CLOSE #1
CLOSE #1 END
END
168.Write a program that reads the ”INFO.DAT” file that 169.A sequential data file’post.dat’ has few records related
has several record such as name, address, gender, post, and to name, address, salary.WAP to display the records whose
salary .The program display those record whose sex is male address begins with ‘S’ or ‘D’
and salary more than 10,000 and also the program counts OPEN "POST.DAT" FOR INPUT AS #1
the total number of records in that file. CLS
OPEN "INFO.DAT" FOR INPUT AS #1 WHILE NOT EOF (1)
CLS INPUT #1, N$, P$, S
WHILE NOT EOF (1) A$ = UCASE$(LEFT$(N$,1))
INPUT #1, N$, A$, G$, P$, S IF A$ = “S” OR A$ = “D” THEN PRINT N$, P$, S
C=C+1 WEND
IF UCASE$(G$)=”M” AND S >= 10000 THEN PRINT N$, A$, G$, CLOSE #1
P$, S END
WEND
PRINT “TOTAL NUMBER OF RECORDS=”; C
CLOSE #1
END
170.Write a program to open a data file “record.dat” that 171.A sequential data file “Record.dat” has few records
contains name, address, date of birth, email and telephone related to name, address, post and DOB(mm/dd/yyyy).
number of some employees. Now display all those records WAP to display the records of all those who were born
whose date of birth is in current month. between 1971 to 1999.
https://seeqbasicomputer.blogspot.com/ 125 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
172.Write a Qbasic program that read the "EMP.DAT" file 173.A sequential data file has 100 records having field
with Name, Address, Post and Salary columns from E: name, class and roll number. Write a program to display
drive that has 500 records of employees and displays only from 50th to 60th records.
its last 50 records.
OPEN "E:\EMP.DAT" FOR INPUT AS #1 OPEN "ABC.DAT" FOR INPUT AS #1
CLS CLS
FOR i = 1 TO 500 WHILE NOT EOF (1)
INPUT #1, n$, a$, p$, s INPUT #1, N$, C, R
D=D+1
IF i >= 450 AND i <= 500 THEN PRINT n$, a$, p$, s IF D >= 50 AND D <= 60 THEN PRINT N$, C, R
NEXT i WEND
CLOSE #1 CLOSE #1
END END
174.Write a program to display the first 10 records from a 175.A data file named “EMP.DAT” contains some records
file named “resource.dat” having fields name, phone and with the fields Code, Name, Post and Salary. Write a
email. program to print odd position records of the data file.
OPEN "EMP.DAT" FOR INPUT AS #1
OPEN "RESOURCE.DAT" FOR INPUT AS #1 CLS
CLS WHILE NOT EOF (1)
FOR I = 1 TO 10 INPUT #1, C, N$, P$, S
INPUT #1, N$, C, R D=D+1
PRINT N$, C, R IF MOD 2 = 1 THEN PRINT C, N$, P$, S
NEXT I WEND
CLOSE #1 CLOSE #1
END END
176.A sequential data file named “abc.dat” has several 177.A data file named “record.dat” contains name, age and
records having fields name, roll and class. Write a program salary for n number of persons. Write a program to input a
to copy all the records of class 10 into a newly created file name to search data from a data file. If the data is not
new.dat. found, then display the message “Data not found in the
list”.
OPEN "ABC.DAT" FOR INPUT AS #1 OPEN “RECORD.DAT” FOR INPUT AS #1
OPEN "NEW.DAT" FOR OUTPUT AS #1 CLS
CLS INPUT “Enter name to be searched”; S$
WHILE NOT EOF (1) FLAG=0
INPUT #1, N$, R, C
IF C = 10 THEN WRITE #2, N$, R, C
WHILE NOT EOF(1)
WEND INPUT #1, N$, A$, S
CLOSE #1, #2 IF UCASE$(S$)=UCASE$(N$) THEN
END PRINT N$, A$, S
FLAG=1
END IF
WEND
IF FLAG=0 THEN PRINT “Data not found”
CLOSE #1
END
178.A sequential data file 'Student.dat' contains registration 179.WAP that asks a post of the employee and displays his/her
number, student name, address and date of birth of some students. records from the sequential data file “XYZ.REC” having fields
Write a program that asks a user to input a registration number Name, Post, Dept and Salary.
and displays the record of the particular registration if present. OPEN “XYZ.REC” FOR INPUT AS #1
OPEN “STUDENT.DAT” FOR INPUT AS #1 CLS
CLS INPUT “Enter post to be searched”; S$
INPUT “Enter registration no. to be searched”; S FLAG=0
FLAG=0 WHILE NOT EOF(1)
WHILE NOT EOF(1) INPUT #1, N$, P$, D$, S
INPUT #1, R, N$, A$, D$ IF UCASE$(S$)=UCASE$(P$) THEN
IF S = R THEN PRINT N$, P$, D$, S
PRINT R, N$, A$, D$ FLAG=1
FLAG=1 END IF
END IF WEND
WEND IF FLAG=0 THEN PRINT “Data not found”
IF FLAG=0 THEN PRINT “Data not found” CLOSE #1
CLOSE #1 END
END
https://seeqbasicomputer.blogspot.com/ 126 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
180.Delete some records from “neps.dat” file where 181.A sequential data file “RECORD.DAT” contains
computer ask user to enter the record, which is to be different records under fields: name rollno., name, address
deleted. (Fields are name, address, and telephone number) and percentage. Write a program to edit a record and
display both edited and unedited records on the screen to
OPEN “NEPS.DAT” FOR INPUT AS #1 compare them side by side.
OPEN “TEMP.DAT” FOR OUTPUT AS #1 OPEN "D:\RECORD" FOR INPUT AS #1
CLS OPEN "d:\TEMP.DAT" FOR OUTPUT AS #2
INPUT “Enter name which is to be deleted”; D$ CLS
WHILE NOT EOF(1) INPUT "ENTER ROLL NUMBER TO EDIT DATA"; E
INPUT #1, N$, A$, T# FLAG = 0
IF UCASE$(D$)<>UCASE$(N$) THEN WHILE NOT EOF(1)
WRITE #2, N$, A$, T# INPUT #1, R, N$, A$, P
ELSE IF E <> R THEN
PRINT “Deleted data=”; N$, A$, T# WRITE #2, R, N$, A$, P
END IF ELSE
WEND INPUT "ENTER ROLL NUMBER"; ER
CLOSE #1, #2 INPUT "ENTER NAME"; EN$
KILL “NEPS.DAT” INPUT "ENTER ADDRESS"; EA$
NAME “TEMP.DAT” AS “NEPS.DAT” INPUT "ENTER PERCENTAGE"; EP
END WRITE #2, ER, EN$, EA$, EP
---------------------------------------------------------------------------- FLAG = 1
182.A sequential data file “marks.dat” contains information END IF
such as student’s name, marks obtained in math, science WEND
and computer. Write a program that increase the marks of IF FLAG = 0 THEN
computer by 10 of those student who secured less than 40 PRINT "DATA NOT FOUND"
OPEN "D:\PATIENT.DAT" FOR INPUT AS #1 ELSE
OPEN "d:\TEMP.DAT" FOR OUTPUT AS #2 PRINT "NON EDITED DATA"
CLS PRINT "ROLL NUMBER= "; R
FLAG = 0 PRINT "NAME= "; N$
WHILE NOT EOF(1) PRINT "ADDRESS= "; A$
INPUT #1, N$, A, B, C PRINT "PERCENTAGE= "; P
PRINT "---------------"
IF C > 40 THEN
PRINT "EDITED DATA"
WRITE #2, N$, A, B, C
PRINT "ROLL NUMBER: "; ER
ELSE PRINT "NAME: "; EN$
C = C + 10 PRINT "ADDRESS: "; EA$
WRITE #2, N$, A, B, C PRINT "PERCENTAGE: "; EP
FLAG = 1 END IF
END IF CLOSE
WEND KILL "D:\SALARY.DAT"
IF FLAG = 0 THEN NAME "D:\TEMP.DAT" AS "D:\SALARY.DAT"
PRINT "DATA NOT FOUND" END
ELSE
PRINT "DATA EDITED"
END IF
CLOSE
KILL "D:\PATIENT.DAT"
NAME "D:\TEMP.DAT" AS "D:\PATIENT.DAT"
END
https://seeqbasicomputer.blogspot.com/ 127 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
Number System [300]
[SLC 2065] i) (228)8 into ii) (CA3)16 into binary i) 11×11 ii) Divide 1110 by 11
decimal
[SLC 2065 S] i) (756)8 into ii) (1011011011)2 into (11011x110)-11101 111100÷1000
binary hexadecimal
[SLC 2066] i) (101)10 into ii)(78)8 into decimal 10101-1011 110*11
binary
[SLC 2066 S] i) (524)10 into ii) (31A)16 into Binary 1011x101 1010-111+101
Octal
[SLC 2067] i) (AC3)16 into ii) (110010)2 into octal 11*11-101 Divide 1010 by 10
decimal
[SLC 2067 S] i) (7AF)16 into ii) (1101101)2 into octal 11*11+11 110÷10
binary
[SLC 2068] i) (108)10 into ii) (173)8 into binary 111*11 1010-10+11
binary
[SLC 2068 S] i) (168)10 into ii) (1011)2 into decimal 1011+1101 110x11
binary
[SLC 2069] i) (684)10 into ii) (101011)2 into decimal 1011×11 Divide 100101 by 110
octal
[SLC 2069 S] i) (442)8 into ii) (AB)16 into binary 101 x 10 divide 1101 by 111
decimal
[SLC 2070] i) (BED)16 into ii) (1010111)2 into octal 1010 × 10 10101 ÷ 11
binary
[SLC 2070 S] (209)10-(x)2 ii (537)8-(x)2 101 x 111 110111-1011
[SLC 2071] (108)10 into binary ii) (765)8 into decimal 111×11 Divide 1101 by 11
[SLC 2071 S] (74)8 to decimal (FAC)16 into binary 111×11 101–11
[SLC 2072] (i) (208)10 into (104)8 into decimal 1011 + 1101 110 x 11
Binary
[SEE 2073] (BAD)16 into (1111001)2 into octal 11 x 10 + 11 110 10
Binary
[SEE 2073 U] (364)8 into (1101010)2 into octal 1011 x 101 100101 ÷ 101
decimal
[SLC 2074] (523)8 into Binary (2074)8 into hexadecimal 110 x 101 111010 110
[SEE 2074 U] (CCA)16 into (479)10 into octal (1010) x (111) (10011) ÷ 10
decimal
[SQE 2075K] (235)8 into (BA5)16 into binary (1111 + 1101) – 1101 ´ 11 ¸ 101
decimal (1001)
[SEE 2075 U] (546)8 into (1011100111)2 into 1011 × 101 100101 ¸ 110
decimal Hexadecimal
[SEE 2075] (217)10 into (39C)16 into Decimal 1011 × 11 110111 – 11001
Binary
[SEE 2075 S2] (FA)16 into (420)10 into octal 111 x 10 1101 ÷ 101
Binary
[MM 2076] (974)10 into octal (B52)16 into binary (1011 + 10100) – 1100101 ¸ 101
(1001)
[MFT 2076] (645)8 into decimal (873)10 into Hexa (11011 + 10101) -
1010
(10111011)2 into octal 10101×111 1011011110
[PMT 2075] (105)8 into binary (357)16 into octal (111 ´ 11) – 111 1101 + 101 110
[MFT 2075] (364)8 into (945)10 into Hexa (10101 + 11101) - (10101 + 11101) -
Decimal 1011 1011
(101101011)2 into (1011011) / (101)
Octal
[U1] (AB3)16=(...?...)10 (547)8=(…?...)2 10100-1111+101 Divide 10111 by 101
101011)2 = (?)10 (501)8 into Decimal (1100-101)2 Divide 1011 by 10
https://seeqbasicomputer.blogspot.com/ 128 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha
(235)8 into decimal (BC0D)16 into Binary 10x11+101 111111÷111
(BA5)16 into binary (73)8 into (?)10 11001 – 110 1010011÷111
(ABC)16 to decimal (1352)8 into decimal (10001)2 + (111)2 (110000 /111)
(77)8 to Hexadecimal (CAFE)16 into Octal 1101x11+1011 (10111011) / (101)
(DOE)16 to (?)8 (101101)8 into Decimal 101011+110011-11110 Divide 110111 by 101
(317)10 to (?)2 (DAD)16 = (?)8 (1111+10001) x 111 101011÷111
(48)10 to (?)2 (1204)8 = (?)2 (110101) + (111) – (101) divided 1101 by 101
(75)8to (?)10 (101001-111) * 110 11101 ÷ 101
(458)10 into Octal (167)8= into hexadecimal 10101+110011-10110
(101101101101)2 into (1010111100)2 into 10*111+101 (101x11)2÷100
Hexadecimal Hexadecimal
(11011111101)2 into (?)2 (75)8 into binary (110+10000) x 11 1001 × 101 ÷11
(CAD)16 into (?)10 (675)8 = (?)16 (111000 +111) 1101×11÷111
(45)10 into (?)2 (657)10 = (?)8 (100100 - 11101)2 1001 x 11÷111
(4102)8 into (x)2 (216)10 into (x)16 (1011+1011-111)2 (1110 ÷ 10) + (110)
(486)10 into Hexadecimal (705)8 into Binary 1111+111-101 101110÷111
(487)10 into Hexadecimal (407)8 into Binary 110000 – 10011 1010110÷110
(81)10intoto binary (608)10 =(?)2 1011 * 11 Divide 1101 by 110
(453)8 into hexadecimal (10110000111)2=(?)8 1010+111-101 (1101×110) ÷ 11
(564)10 =(?)2 (100011110111)2=(?)8 1011+110-101 Divide: 101010 by 111
(534)8 into decimal (ACB)16 into binary (1001 - 111) x (111)
(631)10 into Octal (111000000110)2 into (10100)+(1101) (101 × 10)2 + (11 × 10)2 –
Hexadecimal (110)2 – (101)2
(42)10 =(?)2 (14)8 =(?)10 (10100)+(1011) –(1101) Divide 110011 by 11
(30A)16=(?)8 (931)10=(?)16 (110)x11+101 (111001)2 ÷ (101)2
(10011)2 = (?)8 (2A0)16=(?)2 11001 + 1110 – 101 (10100101)2 ÷ (111)2
(715)8 into decimal (BAC)16 into binary (101011-111) × 11 Divide 100101 by 110
(B07)16 =(?)10 (507)8 into Decimal (111)2 × (110)2 – (1101)2 (1110 x1010)2 ÷ 1001
(261)8 =(?)2 (CAFE)16 into Binary (114)2×(101)2-(111)2 101101/100
(1702)8 = (?)16 (1007)10 into hexadecimal (110011 - 11101)2 (100101)2÷(110)2
1005)10 = (?)2 (100010)2 into decimal 1101×101-1101 101110÷111
(101)8 = (?)16 (3AB)16 into octal 110001-(111×10) (10111 x 101) ÷ 1010
(701)8into decimal (1245)10 into binary (1001011)2 ×(1010)2 Divide 1001011 by 100
(CA7E)16 into octal (504)8 into decimal 1010+110-10 Divide 1011011 by 100
(10101111)2= (?)10 (110101011)2 into Hexa (1101+11010)-1001 1010 ÷ 101
decimal
(324)8=(?)16 (231)8 =(?)10 101 + 1001 - 101 (101101 ÷ 110)
(6DB)16=(?)10 (1D3)16 =(?)2 101 × 10 + 10 101101 ÷ 10
(64)8 into binary (233)8 = (?)10 (111001 - 11) + 111001 Divide 100100 by 11
(31A)16 into Binary (108)10 into binary 110*11 divide 1101 by 111
(7AF)16 into binary (173)8 into binary 11*11-101 divide 1011011 by 111
(1101101)2 into octal (684)10 into octal 111*11 10101 ÷ 11
(168)10 into binary (101011)2 into decimal 1010-10+11 110 10
https://seeqbasicomputer.blogspot.com/ 129 |
Page
SEE COMPUTER SCIENCE 2076 Compiled by: Deepak Shrestha