Solved SLC Computer Science 2067
SLC Examination-2067(2011)
Computer Fundamental (22 marks)
1. Answer the following questions:
a. Write any two examples of data communication.
Ans: Any two examples of data communication are
1. E-mail
2. Telephone
b. What do you mean by web browser?Ans: Web browser is a computer program that access web pages and displays them on the user computer.
c. Write any four advantages of multimedia.Ans: Any four advantages of multimedia are:
i) It makes teaching / learning easier in classroom.
ii) It makes easy to share views, ideas and thoughts among various people.
iii) It can store data and information for longer period.
iv) It makes presentation of related subject matter attractive.
d. Mention any four symptoms of computer virus.Ans: Any four symptoms of computer virus are:
i) Program takes long time to load.
ii) The floppy disk or hard disk is suddenly accessed without a logical reason.
iii) Increased use of disk space and growth in file size.
iv) Corrupting the system data.
e. What is computer security?Ans: 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.
3. Match the following:Group A Group B
a) Satellite a) Multimedia
b) HTTP b) Protocol
c) Online business c) Unguided media
d) Fiber optics d) E-commerce
Answers
Group A Group B
a) Satellite Unguided media
b) HTTP Protocol
c) Online business E-commerce
d) Fiber optics Guided media
4. Choose the correct answer:
a) Which is not a communication media?
i) Wire ii) Microwave iii) Satellite iv) NIC
NIC
b) Which is web browser software?
i) Window 2007 ii) Internet Explorer iii) Windows NT iv) All of the above
Internet Explorer
c)In which topology network devices are connected through hub?
i) Ring topology ii) Bus topology iii) Star topology iv) None of the above
Star topology
d) Which is not related to Internet?
i) ISP ii) TCP/IP iii) WWW iv) UPS
UPS
5. Give appropriate technical terms of the following:
a) An internet tool that helps to upload/download the file.
FTP (File Transfer Protocol)
b) Making duplicate copy of file for security purpose.
b) Making duplicate copy of file for security purpose.
Backup
c) A set of rules that governs how computer exchange information over computer network.
c) A set of rules that governs how computer exchange information over computer network.
Protocol
d) An integrations of audio, video, graphics and text.
d) An integrations of audio, video, graphics and text.
Multimedia
6. Write the full forms:
6. Write the full forms:
a) URL = Uniform Resource
Locator
b)ISP = Internet Service Provide
c)ASCII = American Standard Code for Information
Interchange
d)bps = bits per second
Group B-Database
7. Answer the following questions:
a) Define DBMS with examples.
Ans: DBMS is a software which is used to manage data, manipulate them and provide the information. Examples of DBMS are MS-Access and Oracle.
b) What is primary key?Ans: Primary key is a field that uniquely identifies the record. It is needed because it neither accepts duplicate values now null values.
c) Why is reporter created?
Ans: Report is created to print documents according to user’s specifications of the summarized information through query or table.
8. Choose the best answer:
a) Which is not a type of query?
i) Search ii) Select iii) Update iv)All of the above
Search
b) The storage size of data and time is :
i) 4 bytes ii)6 bytes iii)8 bytes iv)10 bytes
8 bytes
c) Collecting multiple related fields is called:
i)Records ii)Table iii) Forms iv)Query
Records
d) The data type appropriate to store salary is:
i)Memo ii)Currency iii)Text iv) Auto number
Currency
9. Match the following:
a)OLE a)Report
b) Data entry b) Picture
c)Indexing c) Table
d)Formatted printout d)Fast searching
e)Form
9. Match the following:
a)OLE a)Report
b) Data entry b) Picture
c)Indexing c) Table
d)Formatted printout d)Fast searching
e)Form
Answers
a)OLE Picture
b) Data entry Form
c)Indexing Fast searching
d)Formatted printout Report
Group C-Programming
10. i) What is procedure?
Ans: Procedure is a block of statement that solves a particular problem
ii) Write any two characteristics of C language.
Ans: Any two characteristics are :
i) It is a high level language with some features of low level language.
ii) It is mostly used to prepare system software.
iii) Write the function of:
-INPUT
Ans: It reads data from the sequential data file.
-MKDIR
Ans: It creates a subdirectory which is used to manage files.
11. Write the output of the following program.
DECLARE SUB RESULT(N$)
N$ = "SCIENCE"
CALL RESULT(N$)
END
SUB RESULT (N$)
B = LEN(N$)
COUNT = 1
WHILE COUNT <= B
X$ = X$ + MID$(N$, COUNT, 1)
COUNT = COUNT + 2
WEND
PRINT X$
END SUB
12. Rewrite the given program after correcting the bugs.
REM to display all the records from sequential Rem data file ABC.DAT
OPEN “ABC.DAT” FOR OUTPUT AS # 1 DO WHILE NOT EOF(“ABC.DAT”)
INPUT # 1,N$,A
PRINT N$,A
CLOSE 1
END
Debugged Program
REM to display all the records from sequential Rem data file ABC.DAT
OPEN “ABC.DAT” FOR INPUT AS # 1
DO WHILE NOT EOF (1)
INPUT # 1,N$,A
PRINT N$,A
LOOP
CLOSE #1
END
13. Read the program given below and answer the following questions.
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
i) In which condition the statements within the WHILE….WEND looping statement will not be executed?
Ans: When the value of N becomes 0 or when the condition becomes false the statements within the WHILE….WEND looping statement will not be executed
ii) Will the output be the same if we place “/” instead of”\” in the above program.
Ans: No, the output will not be same if we place “/” instead of”\” in the above program.
14. i) Using FUNCTION…END FUNTION, write a program to calculate the average of three numbers.
DECLARE FUNCTION
AVERAGE (A, B, C)
CLS
INPUT “ENTER FIRST
NUMBER”; A
INPUT “ENTER
SECOND NUMBER”; B
INPUT “ENTER THIRD
NUMBER”; C
AV = AVERAGE(A, B,
C)
PRINT “AVERAGE OF
THREE NUMBERS”; AV
END
FUNCTION AVERAGE
(A, B, C)
AVGR = (A + B + C)
/ 3
AVERAGE = AVGR
END FUNCTION
ii) Using SUB…END SUB, write a program to test whether the given number is completely divisible by 3 or not.
DECLARE
SUB CHECK (N)
CLS
INPUT
“ENTER ANY NUMBER”; N
CALL CHECK
(N)
END
SUB CHECK
(N)
IF N MOD 3
= 0 THEN
PRINT N;
IS DIVISIBLE BY 3”
ELSE
PRINT N;
IS NOT DIVISIBLE BY 3”
END IF
END SUB
iii) A sequential data file “EMP.DAT” contains name, post and salary fields of information about employees. Write a program to display all the information of employees along with tax amount (also tax is 15% of salary).
OPEN “EMP.DAT” FOR INPUT AS #1
CLS
PRINT “NAME”, “POST”, “SALARY”, “TAX”
WHILE NOT EOF(1)
INPUT #1, N$, P$, S
T = 15 / 100 * S
PRINT N$, P$, S, T
WEND
CLOSE #1
END
SLC
Examination 2068 (2012)
Optional
II [Computer Science]
Examinees are required
to answer in their own words as far as practicable. Credit shall be given to
clarity and originality, not rote learning.
Time: 1 hour 30 minutes Full
Marks: 50
Pass
Marks:20
Attempt
all the questions.
Computer fundamental (22 marks)
1. Answer the following questions:
a) Define LAN topology and write any two types of LAN topology.
1. Answer the following questions:
a) Define LAN topology and write any two types of LAN topology.
Ans:
The arrangement or connection pattern of computers or nodes and other devices
of the network is known as LAN topology.
Any two types of LAN topology are
i) Bus topology
ii) Star topology
b) Write any four services of Internet.
b) Write any four services of Internet.
Ans: Any four services of internet are
i)
E-mail (Electronic mail)
ii) FTP (File Transfer Protocol)
iii) IRC (internet Relay Chat)
iv) E-commerce
ii) FTP (File Transfer Protocol)
iii) IRC (internet Relay Chat)
iv) E-commerce
c) Write any two advantages of multimedia in
education field.
Ans: Any two ad advantages of multimedia in education
field are
i) It makes teaching/learning easier in classroom.
iv) It makes presentation of related subject matter
attractive.
d) Write any two software security measures.
d) Write any two software security measures.
Ans: Any two software security measures are:
i) Backup
ii) Password
e) Write any four symptoms that show, computer is infected by computer virus.
e) Write any four symptoms that show, computer is infected by computer virus.
Ans: Any four symptoms that show, computer is infected
by computer virus are :
i)
Program takes long time to load.
ii) The floppy disk or hard disk is suddenly accessed without a logical reason.
iii) Increased use of disk space and growth in file size.
iv) Corrupting the system data.
ii) The floppy disk or hard disk is suddenly accessed without a logical reason.
iii) Increased use of disk space and growth in file size.
iv) Corrupting the system data.
3. Match the following:
Group A Group B
a) Microwave a) Multimedia
b) Volt guard b) Protocol
c) Sound card c) Unguided media
d) TCP/IP d) Power protection devices
e) Guided media
Group A Group B
a) Microwave a) Multimedia
b) Volt guard b) Protocol
c) Sound card c) Unguided media
d) TCP/IP d) Power protection devices
e) Guided media
Answers
Group A Group
B
a) Microwave Unguided media
b) Volt guard Power protection devices
c) Sound card Multimedia
d) TCP/IP Protocol
4. Select the best answers:
a) Which of the following is not a protocol?
i) POP ii) TCP/IP iii) NOS iv) FTP
a) Microwave Unguided media
b) Volt guard Power protection devices
c) Sound card Multimedia
d) TCP/IP Protocol
4. Select the best answers:
a) Which of the following is not a protocol?
i) POP ii) TCP/IP iii) NOS iv) FTP
NOS
b) Which device protects hardware?
i) UPS ii) MODEM iii) Gateway iv) All of the above
UPS
c) In which communication media data transfer high?
i) Twisted pair ii) Co-axial cable iii) Fiber optics
iv) Microwave
Fiber
optics
d) Which computer virus damages the master boot record?
i) Macro virus ii) File virus iii) New folder virus
iv) Boot sector virus
Boot
sector virus
5. Write the appropriate
technical terms:
a) The device used to connect PC with telephone line.
a) The device used to connect PC with telephone line.
MODEM
b) The rules that make the network communication possible.
Protocol
c) A program that effect the normal functioning of computer.
Computer
Virus
d) A main computer in the computer network.
Server
6. Write down the full forms:
a) bps = bits per second
6. Write down the full forms:
a) bps = bits per second
b) MAN = Metropolitan
Area Network
c) FTP = File
Transfer Protocol
iv)URL = Uniform
Resource Locator
Group B-Database Management(10 marks)
7. Answer the following questions:
a) What is database?
Group B-Database Management(10 marks)
7. Answer the following questions:
a) What is database?
Ans: Database is a collection of related and organized
information that can be used for different purpose.
b) What is data sorting?
Ans:
Data sorting means grouping all the records in a table either in ascending or
descending order based on a key field of the record.
c)
What is a form?
Ans:
Form is an object of MS-Access which provides a user friendly interface to
enter data in a table or multiple linked tables.
8. Select the best
answers:
a) ………………. Is not a data type of MS-Access.
i) Number ii) Text iii) Memo iv) Form
a) ………………. Is not a data type of MS-Access.
i) Number ii) Text iii) Memo iv) Form
Form
b) Primary key does not accept ……….
i) Text ii) Number iii) Null value iv) None of the above
Null value
c) ……………….. object of access is used to print
formatted data.
i) Query ii) Form iii) Report iv) Table
i) Query ii) Form iii) Report iv) Table
Report
d) In MS-Access data are stored in ………………
i) Form ii) Query iii) Table iv) All of the above
Table
9. Match the following:
Group A Group B
a) Indexing a) Limits the value
b) Report b) Data type
c) Validation Rule c) Error messages
d) Hyper link d) Final output
e) Search fast
9. Match the following:
Group A Group B
a) Indexing a) Limits the value
b) Report b) Data type
c) Validation Rule c) Error messages
d) Hyper link d) Final output
e) Search fast
Answers
Group A Group
B
a) Indexing Search fast b) Report Final output c) Validation Rule Limits the value
d) Hyper link Data type
a) Indexing Search fast b) Report Final output c) Validation Rule Limits the value
d) Hyper link Data type
Group C- Programming (18 marks)
10. a) What is loop?
Ans:
Loop means executing a statement or group of statements a certain number of
times depending upon the condition.
b)
List any two data types supported by ‘C’ language.
Ans: Any two data types supported by ‘C’ language are:
i) char
ii) int
c) State the function of the following statement:
i) EOF
Ans: It detects the end of the file
marker reading the data from an open sequential file.
ii) MKDIRAns:
It creates a subdirectory which is used to manage files.
11. Re-write the given
program after correcting the bugs:
CREATE FUNCTION Square(A)
Rem to print square of a number
CLS
Get “a number”; A
CALL square(A)
END
FUNCTION square(A)
Ans=A^2
Square=Ans
END Square(A)
CREATE FUNCTION Square(A)
Rem to print square of a number
CLS
Get “a number”; A
CALL square(A)
END
FUNCTION square(A)
Ans=A^2
Square=Ans
END Square(A)
Debugged ProgramDECLARE
FUNCTION Square(A)
Rem to print square of a number
CLS
INPUT “a number”; A
PRINT square(A)
END
FUNCTION square(A)
Ans=A^2
Square=Ans
END FUNCTION
Rem to print square of a number
CLS
INPUT “a number”; A
PRINT square(A)
END
FUNCTION square(A)
Ans=A^2
Square=Ans
END FUNCTION
13. Analyze the program
given below and answer the questions:
Declare function count(N$)
Input “Enter a word”; R$
C= Count(R$)
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.
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 used in the above program are
1) UCASE$(
)
2) 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’ inline 3 [i.e. C=Count(R$)] given in the above program is to call the function and store the value returned by the function count.
14. a) Write a program to calculate the area of four walls using SUB…END SUB.
DECLARE SUB AREA (L, B, H)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
CALL AREA (L, B, H)
END
SUB AREA(L, B, H)
A = 2 * H * (L + B)
PRINT “AREA OF FOUR WALLS=”; A
END SUB
b) Write a program using FUNCTION…..END
FUNCTION to get a word
from the user and print it in
reverse order.
DECLARE FUNCTION REV$ (S$)
CLS
INPUT
"ENTER ANY WORD"; S$
PRINT
"REVERSED WORD IS "; REV$(S$)
END
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
c) A sequential data file called
“student.dat” contains some records under the
field’s name, English, Nepali and
Computer. Write a program to add some
more records in the same
sequential data file.
OPEN “student.dat” FOR APPEND AS #1
DO
CLS
INPUT “ENTER NAME”; N$
INPUT “ENTER MARKS IN ENGLISH”; E
INPUT “ENTER MARKS IN NEPALI”; N
INPUT “ENTER MARKS IN COMPUTER”; C
WRITE #1, N$, E, N, C
INPUT “DO YOU WANT TO CONTINUE”; CH$
LOOP WHILE UCASE$(CH$) = “Y”
CLOSE #1
END
***
Solved SLC Computer Science 2069
SLC Examination 2069 (2013)
Optional II [Computer Science]
Examinees are required to answer in their own words as far as practicable. Credit shall be given to clarity and originality, not rote learning.
Time: 1 hour 30 minutes Full Marks: 50
Pass Marks:20
Attempt all the questions.
Computer Fundamental (22 marks)
Computer Fundamental (22 marks)
1. Answer the following questions:
a) Write any four advantages of computer network.
Ans: Any 4 advantages of computer network are as follows:
i) Computer in a network can access network connected hardware devices like printer, disk drives, etc.
ii) Information can be exchanged rapidly in computer network.
iii) Computers in a network environment can be updated from any computer.
iv) Software packages can be shared between network connected computers.
b) What is internet? Write the name of any two E-commerce sites.
Ans: Internet is an interconnection of several thousands of computers of different types belonging to the various networks all over the world.
c) What is computer ethic?
Ans: Computer ethics is the set of moral principles or code of conducts that should be followed by computer user.
d) What is hardware security? Write any two software security measures.
Ans: The security given to the various hardware tools or equipment from being lost or damaged due to accidental or intentional harm is hardware security.
Any two software security measures are:
i) password
ii) backup
e) What is computer virus?
Ans: Computer virus is a program written by the programmer with the intention of destroying and damaging the data and programs residing in the computer system.
3. Match the following:Group
A Group B
a) RJ-45 a) Multimedia
b) WAN b) Duplicate copy
c) Back up c) Fiber optic cable
d) microphone d) Twisted pair cable
e) Internet
a) RJ-45 a) Multimedia
b) WAN b) Duplicate copy
c) Back up c) Fiber optic cable
d) microphone d) Twisted pair cable
e) Internet
Answers
Group A Group B
a) RJ-45 a) Twisted pair cable
b) WAN b) Internet
c) Back up c) Duplicate copy
d) microphone d) Multimedia
4. Select the best answer:a)
Which is not unguided media?
i) Fiber optics ii) Microwave iii) Infrared iv) Radio wave
i) Fiber optics ii) Microwave iii) Infrared iv) Radio wave
Ans: Fiber optics
b) Which is the internet service?
i) IRC ii) Telnet iii) E-mail iv) All of the above
Ans: All of the above
c) Which is not related to multimedia?
i) Printer ii) Sound card iii) Microphone iv) CD-ROM
Ans: Printer
d) Which virus infects boot sector files?
i) Macro virus ii) Multipartite virus iii) Boot sector virus
iv) Program virus
Ans: Boot sector virus
5. Give appropriate technical terms: a) Business through internet.
Ans: E-commerce
b) The software that protects computer virus.
b) The software that protects computer virus.
Ans: Antivirus Software
c) Physical layout of LAN.
c) Physical layout of LAN.
Ans: Topology
d) A sector word that gives user access to a particular program or computer
d) A sector word that gives user access to a particular program or computer
system.
Ans: Password
6. Write the full forms of: a) VOIP = Voice Over Internet Protocol
6. Write the full forms of: a) VOIP = Voice Over Internet Protocol
b)
MAN = Metropolitan Area Network
c)
UTP = Unshielded
Twisted Pair
d)
WWW = World Wide Web
Group B Database(10 marks) 7. Answer the following questions:
Group B Database(10 marks) 7. Answer the following questions:
a) What is database? Give two examples.
Ans: Database is a collection of related and organized information that can be used for different purpose.
Two examples of database are:
i) Dictionary
ii) Telephone Directory
b) Write any two types of primary key.
Ans: The uses of Primary key are:
i) To reduce and control duplication of record in a table.
ii) To set the relationship between tables.
c) What is query?
Ans: Query is an
object of Ms-Access which extracts and arranges information from a table.
8. Choose the best answer:
a) Which of the following is not a database application?
i) Oracle ii) Foxpro iii) MS-Access iv) MS-Excel
Ans: MS-Excel
b) Memory space consumed by a currency data type maximally is …………
i) 2 bytes ii) 4 bytes iii) 8 bytes iv) 1 GB
b) Memory space consumed by a currency data type maximally is …………
i) 2 bytes ii) 4 bytes iii) 8 bytes iv) 1 GB
Ans: 8 bytes
c) The default data type of MS-Access is:
i) Number ii)Text iii) Memo iv) Auto number
c) The default data type of MS-Access is:
i) Number ii)Text iii) Memo iv) Auto number
Ans: Text
d) Row is also called …………
i) Record ii) Field iii) Database iv) Table
d) Row is also called …………
i) Record ii) Field iii) Database iv) Table
Ans: Record
9. Match the following: Group A Group B
i) OLE a) Data Entry
ii) Hyperlink b) Formatted Hardcopy
iii) Report c) 1 GB
iv) Form d) Up to 255 characters
e) Up to 2048 characters
Answers
Group A Group B
i) OLE 1 GB ii) Hyperlink Up to 2048 characters
iii) Report Formatted Hardcopy
i) OLE 1 GB ii) Hyperlink Up to 2048 characters
iii) Report Formatted Hardcopy
iv) Form Data Entry
Group-C
Programming(18 marks)
10.a) What is meant by mode of data file?
Ans: 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.
b) Write any two characteristics of ‘C’ language.
Ans: The characteristics are :
i) It is a high level language with some features of low level language.
ii) It is mostly used to prepare system software.
c) Write the
function of the following statements:
i) NAME
i) NAME
Ans: The NAME statement renames a file on
a disk.
ii) KILL
Ans: The KILL statement
deletes the file or files from the specified drive and directory.
11. Write the output of the following program
DELARE SUB NUMBER()
CLS
CALL NUMBER
END
SUB NUMBER
N=3
C=1
WHILE C<=5
PRINT N
N=N*10+3
C=C+1
WEND
END SUB
12. Rewrite the given program after correcting the bugs:
REM display Records of students From Data File
OPEN “STDREC.DAT” FOR INP AS #1
PRINT “ROLL”,”NAME”,”ADDRESS”,”CLASS”,”SECTION”
DO WHILE NOT EOF
INPUT #1,RN,N$,AD$,CL,S$
PRINT RN,N$,AD$,CL,S$
NEXT
CLOSE #1
END
Debugged Program
REM display Records of students From Data File
OPEN “STDREC.DAT” FOR INPUT AS #1
PRINT “ROLL”, ”NAME”, ”ADDRESS”, ”CLASS”, ”SECTION”
DO WHILE NOT EOF (1)
INPUT #1, RN, N$, AD$, CL, S$
PRINT RN, N$, AD$, CL, S$
LOOP
CLOSE #1
END
13. Study the following program and answer the given questions:DECLARE SUB EXAM(N$)
CLS
INPUT “Enter word”;WO$
CALL EXAM(WO$)
END
SUB EXAM (N$)
FOR I = 1 TO LEN (N$)
PRINT RIGHT$(N$,I)
NEXT I
END SUB
a) Write the names of two built-in functions used in the above program.
Ans: The names of two built-in functions used in above program are LEN( ) and RIGHT$( ) .
b) List the real parameter in the program.
Ans: The real parameter used in the above program is WO$.
14. a) Write a program to find the numbers of vowels
in an input string using ‘FUNCTION…..END FUNCTION’.
DECLARE FUNCTION COUNT (S$)
CLS
INPUT "ENTER ANY STRING"; S$
PRINT "TOTAL NO. OF VOWELS= ";
COUNT(S$)
END
FUNCTION COUNT (S$)
VC = 0
FOR I = 1 TO LEN(S$)
B$ = MID$(S$, I, 1)
C$ = UCASE$(B$)
IF C$ = "A" OR C$ =
"E" OR C$ = "I" OR C$ = "O" OR C$ = "U"
THEN
VC = VC + 1
END IF
NEXT I
COUNT = VC
END FUNCTION
b) Write a program using sub procedure module to print the series 1,1,2,3,5,8.. up to ten terms.
DECLARE SUB SERIES ( )
CLS
CALL SERIES
END
SUB SERIES ( )
A = 1
B = 1
FOR I = 1 TO 10
PRINT A;
C = A + B
A = B
B = C
NEXT I
END SUB
c) Write a program to create a data file ‘teldir.dat’ to store Name, Address and Telephone number of employees according to the need of the user.
OPEN “teldir.dat” FOR OUTPUT AS #1
DO
CLS
INPUT “ENTER
NAME”; N$
INPUT “ENTER
ADDRESS”; A$
INPUT “ENTER
TELEPHONE NUMBER”; T#
WRITE #1, N$, A$,
T#
INPUT “DO YOU WANT
TO CONTINUE(Y/N)”; CH$
LOOP WHILE
UCASE$(CH$) = ”Y”
CLOSE #1
END
***
Solved SLC Computer Science 2070
Computer Fundamental
(22 marks)
1. Answer the following questions: 2×5=10
a) What is network topology? Write any one advantage
of star topology.
The arrangement or
connection pattern of computer or nodes and other devices of the network are
known as network topology.
Any one advantage of
star topology is:
i) Failure of single
computer or cable doesn’t affect the entire network.
b) Give
any two advantages of E-mail over traditional mail.
Any two advantages of
E-mail over traditional mail are
i) It allows sending and
receiving message across the world at very low cost.
ii) Emails are usually
received fairly quickly, most of the time a couple of seconds after they are
sent.
c) List
any two main aims of formulating cyber law in Nepal.
The two main aims of
formulating cyber law in Nepal are:
i) To legalize the transaction
through electronic media to control various types of electronic frauds
ii) To punish a person who does
criminal activities through electronic means especially on computers.
d) Give
any two symptoms of virus attack.
The two symptoms of
virus attacks are:
i) Increased use of disk
space and growth in file size
ii) Program takes long
time to load.
e) Give
the importance of UPS to the computer system.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.
2. a)
Convert as instructed: 0.5×2=1
i) (BED)16 into binary
Converting
Hexadecimal to Binary equivalent value
B
= 1011
E
= 1110
D
= 1101
=
(101111101101)2
ii) (1010111)2 into octal
Converting
Binary to Octal equivalent value
001
= 1
010
= 2
111
= 7
=(127)8
b) Perform the binary calculations 0.5×2=1
3. Match the following 0.5×4=2
Group A Group
B
i)
Combination of several media a)
Guided Media
ii)
POP b)
Power Protection Device
iii)
UTP c)
Multimedia
iv)
UPS d)
Protocol used in e-mail
e)
CD-ROM
Answers
i)
Combination of several media a) Multimedia
ii)
POP b) Protocol used in e-mail
iii)
UTP c) Guided Media
iv)
UPS d) Power Protection Device
4. Choose the correct answer 0.5×4=2
a)
Which of the following is an audio output device?
i)
Microphone ii) Speaker iii) Monitor iv) Printer
Speaker
b)
Which one is not a type of virus?
i)
Message Carrying virus ii)
Boot sector virus
iii)System
virus iv)Special Purpose Application
Infector
Special Purpose Application Infector
c) Which one is bounded
media?
i) Fibre optics ii) Microwave
iii) Infrared iv)Laser
Fibre optics
d) Which one is an
operating system software?
i) MS-Word ii) MS-Excel iii) Firefox iv)
MS-DOS
MS-DOS
5. Give an
appropriate technical term for the following. 0.5×4=2
a) A program that can
disinfect a file from virus
Antivirus Software
b) A person who steals
or destroys other’s data, information and program
Hacker
c) A company that
provides internet service
ISP (Internet
Service Provider)
d) A computer in a
network which can provide services to other computer
Server
6. Write
the full forms of: 0.5×4=2
a) TCP/IP = Transmission Control Protocol / Internet
Protocol
b) LAN = Local Area Network
c) UPS = Uninterruptible Power Supply
d) FTP = File Transfer Protocol
Group B
Database
(10 marks)
7. Answer
the
following:
2×3=6
a) Define data and information.
Data can be numbers, letters or
symbols representing facts and figures which may or may not give any sense.
Information is an organized collection
of related data which gives a complete sense.
b) What is report? Give its importance.
Report is an object of database
which displays the output in an effective way to present the data in a printed
format.
The importance of report are:
i) It displays the information the way we want to view it.
iii) It presents the information in designed layouts by adding necessary titles, setting font colour or font size, etc.
c) Name any four data types that can be defined in
MS-Access.
Any four data types that
can be defined in MS-Access are:
i) Text
ii) Memo
iii) Number
iv) Yes/No
8. Choose
the best
answer. 0.5×4=2
a) The columns in
database tables are called:
i) Record ii) Field iii) Report iv)
Memo
Field
b) Which is suitable
data type to store video?
i) Text ii) Number iii) Hyperlink iv) OLE object
OLE object
c) Text data type can
store maximum of ___characters
i) 250 ii) 350 iii) 255 iv) 355
255
d) Which of the
following is database application?
i) MS-Word ii) MS-Access iii) MS-Excel iv)
QBASIC
MS-Access
9. Match
the
following 0.5×4=2
Group A Group
B
i) Indexing Data a)
Size upto 1 GB
ii) Form b)
Column of datasheet
iii) Field c)
Row on a datasheet
iv) OLE object d)
Searching Fast
e)
Graphical interface for data entry
Answers
Group A Group
B
i) Indexing Data a) Searching Fast
ii) Form b) Graphical interface for data entry
iii) Field c) Column of datasheet
iv) OLE object d) Size upto 1 GB
Group C
Programming
(18 marks)
10. a)
What is a
variable?
1
The data item whose value changes
during the execution of a program is called variable.
b) Name any two data types used in C language. 1 Any two data types used in C language are:
i) char
ii) int
c) Give the functions of: 0.5×2=1
i) NAME AS
The NAME statement renames a file
on a diskette. Only file name changes, data and program
ii) CLOSE
It
closes one or all open files.
11.
Rewrite the following program after correcting the
bugs: 2
DECLARE SUB Series(.)
DLC
EXECUTE Series
END
SUB Series
REM to
generate 2 2 4 6 10….. upto 10th term
P=2
Q=2
FOR Ctr=1 TO 5
DISPLAY
P,Q,
P=P+Q
Q=P+Q
WEND
END Series()
Debugged
Program
DECLARE SUB Series( )
CLS
CALL Series
END
SUB Series
REM to
generate 2 2 4 6 10….. upto 10th term
P=2
Q=2
FOR Ctr=1 TO 5
PRINT P,Q,
P=P+Q
Q=P+Q
NEXT Ctr
END SUB
13. Study
the following program and answer the questions: 1×2=2
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 A, B, S
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.
14. a) Write a program using Function…..End Function
to get temperature in Celsius from the user and then print the temperature in
Fahrenheit.(hint: F=9C/5+32). 3
DECLARE FUNCTION CONVERT (C)
CLS
INPUT “ENTER TEMPERATURE IN CELCIUS”; C
PRINT “TEMPERATURE IN FARENHEIT=”; CONVERT (C)
END
FUNCTION CONVERT (C)
F = 9 * C / 5 + 32
CONVERT = F
END FUNCTION
b) Write a program using Sub….End Sub to get a word
from the user and then print it in reverse
order.
3
DECLARE SUB REV (S$)
CLS
INPUT "ENTER ANY STRING"; S$
CALL REV(S$)
END
SUB REV (S$)
FOR I = LEN(S$) TO 1 STEP -1
W$ = W$ + B$
NEXT I
PRINT "REVERSED STRING IS "; W$
END SUB
c) A sequential data file called “Marks.dat” contains
Name, English, Nepali, Maths and Science Fields. Write a program to display all
the contents of that data file. 3
OPEN “Marks.dat” FOR INPUT AS #1
CLS
PRINT “NAME”, “ENGLISH”, “NEPALI”, “MATHS”, SCIENCE”
WHILE NOT EOF(1)
INPUT #1, N$, E, N, M, S
PRINT N$, E, N, M, S
WEND
CLOSE #1
END
***
Solved SLC Computer Science 2071
SLC 2071
1. Answer the following questions:
a. Give two-two difference between peer-to-peer and client/server network
architecture.
Ans: The difference between peer-to-peer and client/server network architecture are as follows:
Peer-to-peer network
|
Client/server network
|
· A group of computers that acts both as client and server in order to share hardware, software and other resources on the network is known as peer-to-peer network. | ·The network architecture which consist of at least one server and one or more client are known as client/server network. |
· Resource sharing, processing and
communication control are centralized upon the server.
|
· Resource sharing, processing and
communication control are completely decentralized.
|
b. What is the function of file transfer protocol (FTP)?
Ans: The functions of FTP are:
· Enables
to transfer files between two or more than two computers.
· Makes
communication possible between computers on the internet.
c. What is cybercrime? Give any two examples.
Ans: Cybercrime refers to any illegal act involved in computer, computer system or over all computer networks like internet.
Any two examples of cybercrime are:
· Cyber
stalking
· Phishing
d. Write any four preventive measures for computer hardware security.
Ans: Any four preventive measures for computer hardware security are:
· Regular
maintenance
· Insurance
policy
· Power
protection device
· Protection
from theft
e. Write any two medium for transmission of computer virus.
Ans: Any two medium for transmission of computer virus are:
· Sharing
infected internal portable disk like floppy disk, pen drive, CDs, etc.
· Exchanging
data and information over a network.
2. a. Convert as indicated:
i. (108)10 into binary
Ans:
ii. (765)8 into decimal
Ans:
b. Perform the following binary calculations:
i. 111*11
Ans:
ii. Divide 1101 by 11
Ans:
3. Match the following:
a. E-commerce Power
protection device
b. Volt guard Online
shopping
c. Satellite link WAN
d. Sound card Optical
fiber
Multimedia
Ans:
a. E-commerce à Online shopping
b. Volt guard à Power protection device
c. Satellite link à WAN
d. Sound card à Multimedia
4. Choose the best answer:
a. Which of the following is remote login service?
i. Video conferencing ii. FTP iii. Telnet iv. TCP/IP
Ans: Telnet
b. Process of arranging the scattered parts of file into a contiguous
manner is _______.
i. debugging ii. Backup iii.Defragmentation iv. Scandisk
Ans: Defragmentation
c. Which of the following is an audio input device?
i. Printer ii. Microphone iii. Head phone iv. Speaker
Ans: Microphone
d. Virus is a type of ___________.
i. System program ii.Package program iii.Destructive program iv. Web program
Ans: destructive program
5. Technical terms:
a. The data carrying capacity of communication channel.
Ans: Bandwidth
b. The moral principles that control cybercrime.
Ans: Computer ethics
c. Buying and selling product and services online.
Ans: E-commerce
d. An integration of text, audio, graphics and video.
Ans: Multimedia
6. Write down the full forms:
a. LAN : Local Area Network
b. VOIP : Voice Over Internet
Protocol
c. Gbps : Giga bits per second
d. DVD : Digital Versatile Disk
7. Answer the following question:
a. Write any two advantages of computerized database.
Ans: The two advantages of computerized database are:
· It
can store large volume of data for longer period of time.
· Searching
of data is easier as it stores data in ascending or descending order.
b. Name any four objects of MS-Access database.
Ans: The four object of MS-Access are:
· Table
· Form
· Query
· Report
c. What is data sorting?
Ans: Data sorting refers to grouping all the records either in ascending or descending order based on a key field of a record.
8. State whether the following are true or false:
a. Graphics can also be stored in MS-Access database. True
b. Maximum field size of memo field is 256 characters. False
c. A form is an object of MS-Access used for entering data. True
d. An action query makes changes in a table. True
9. Match the following:
a. Indexing data Final
output
b. Report View
data
c. Yes/No Searching
fast
d. Select query Picture
Data type
Ans:
a. Indexing data à Searching fast
b. Report à Final output
c. Yes/No à Data type
d. Select query à View data
10. Answer the following:
a. Mention the types of procedures used in QBasic.
Ans: The types of procedure used in QBasic are:
· Sub
procedure
· Function
procedure
b. Write two characteristics of C language.
Ans: The two characteristics of C language are:
· It
has got rich and powerful set of operators.
· It
is used to prepare system software.
c. Write down the function of:
i. SHARED
Ans: The function of SHARED is to declare a variable globally.
ii. CALL
Ans: The function of CALL statement is to call sub procedure for performing specific task.
11. Re-write the following correcting the bugs:
DECLARE SUB CUBE(N)
CLS
FOR I = 1 TO 5
READ
CALL CUBE(No)
NEXT X
DATA 3, 5, 2, 6, 4
END
SUB CUBE( )
DISPLAY N^3
END SUB
Ans:
DECLARE SUB CUBE(N)
CLS
FOR I = 1 TO 5
READ No
CALL CUBE(No)
NEXT I
DATA 3, 5, 2, 6, 4
END
SUB CUBE(N)
PRINT N^3
END SUB
12. Write down the output:
DECLARE FUNCTION AVGE(A,B,C)
X=10
Y=5
Z=15
AV= AVGE(X,Y,Z)
RPINT “Average of three numbers”; AV
END
FUNCTION AVGE(A, B, C)
S=A+B+C
AVGE = S/3
END FUNCTION
Ans:
The output will be:
Average of three numbers 10
13. Study the following program and answer the following:
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
a. List the library function used in the above program.
Ans: The library function used in the above program is MID$.
b. List the conditional statement used in the above program.
Ans: The conditional statement used in the above program is:
IF C$=”P” THEN
14. a.
Write a program using FUNCTION….END FUNCTION to input a string and count the
total number of consonants.
Ans: DECLARE FUNCTION COUNT(N$)
CLS
INPUT "Enter a string"; N$
PRINT "The total numebr of consonant is"; COUNT(N$)
END
FUNCTION COUNT (N$)
C = 0
FOR I = 1 TO LEN(N$)
B$ = MID$(N$, I, 1)
C$ = UCASE$(B$)
IF C$ <> "A" AND C$ <> "E" AND C$ <> "I" AND C$ <> "O" AND C$ <> "U" THEN C = C + 1
NEXT I
COUNT = C
END FUNCTION
b. Write a program using SUB……END SUB to find the area of circle.
Ans: DECLARE SUB AREA(R)
CLS
INPUT “Enter radius”; R
CONST PI=3.14
CALL AREA(R)
END
SUB AREA(A)
A=PI*R^2
PRINT “The area of circle=”; A
END SUB
c. A data file “Salary.Dat” contains the information of employee regarding their name, post and salary. Write a program to display all the information of employee whose salary is greater than 15000 and less than 40000.
Ans: OPEN “Salary.Dat” FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
INPUT #1, N$, P$, S
IF S>15000 AND S<40000 THEN PRINT N$, P$, S
WEND
CLOSE #1
END
Solved SLC Supp. Computer Science 2065
Supplementary Exam 2065
Group A
COMPUTER
FUNDAMENTALS (22 marks)
1. Answer the following questions:
a) Explain about network topology. Write any two advantages of computer networking.
Ans: The arrangement or connection pattern of computers or nodes and other devices of the network is known as network topology.
Any two advantages of computer networking are :
i. Computer in network share different software packages.
ii. Communication made by computer network is very cheap.
b) What is internet? Write any two advantages of Internet.
Ans: Internet is a collection of millions of computers of different types belonging to various networks all over the world.
Any two advantages of internet are as follows:
i. The internet provides very fast and cheap communication.
ii. It is easy to access information of different governments and countries.
c) What is antivirus software? List any two antivirus software.
Ans: Those software which are designed to detect and remove viruses from the computer system to ensure a virus free environment is known as anti-virus software.
Any two antivirus software are:
i. Norton Antivirus
ii. McAfee
d) What is multimedia? Write any two applications of it.
Ans: The integration of several forms of media like audio, video, animation, etc. to present information in more interactive and understandable way is known as multimedia.
Any two applications of it are as follows:
i. Adding special effects in movies:
Multimedia is used in movies to add special
effects to make movie more realistic and interesting.
ii. Preparing presentation:
Multimedia is used in preparing presentation which helps to convey information in more interesting and interactive way.
e) What do you mean by software security? Write any two methods to protect the computer software.
Ans: The security given to various software or data from being lost or damaged due to accidental or intentional harm is known as software security.
Any two methods to protect the computer software are:
i. Defragmentation
ii. Scan disk
3. Match the following:
Group A Group B
i) McAfee a) Supplies continuous power
ii) UPS b) Internet protocol
iii) Web Browser c) Antivirus software
iv) TCP/IP d) Internet explorer
e) Computer virus
Ans:
Group A Group B
i) McAfee - a) Antivirus software
ii) UPS - b) Supplies continuous power
iii) Web Browser - c) Internet explorer
iv) TCP/IP - d) Internet Protocol
4. State whether the statements are True or False
a) MODEM is necessary to access the internet. False
b) Fiber optics use light to carry a data signal through cable. True
c) Multimedia does not include animation. False
d) Cyber ethics are moral principles that make aware to the computer users. True
5. Give appropriate technical terms:
a) Network of networks.
Ans: Internet
b) A secret code that gives the user to access particular program and system.
Ans: Password
c) Use of Internet to buy and sell goods and services.
Ans: E-commerce
d) The rules and regulations to systematize the computer related technology.
Ans: Cyber law
6. Give the full form:
a) Kbps - Kilobits per second
b) NIC - Network Interface Card
c) MODEM- Modulator Demodulator
d) FTP - File Transfer Protocol
Group B
DATABASE
MANAGEMENT (10 marks)
7. Answer the following
a) Define data and database.
Ans: Data can be numbers, letters or symbols representing facts and figures that may or may not give complete sense.
Database is a collection of related and organized information that is used to store, organize and extract data.
b) Name any four data types that can be defined in MS-ACCESS.
Ans: Any four data types that can be defined in MS-Access are as follows:
i. Number
ii. Text
iii. Memo
iv. Auto number
c) What is a form? Give its importance.
Ans: Form is an object of MS-Access that provides user friendly interface to enter data in a table or multiple linked tables.
Importance of form are as follows:
i. It provides an interactive platform for input if data into the database.
ii. It helps to display data in more presentable form than a datasheet can.
8. State whether the following statements are true or false.
a) A query is used to select fields and records from many tables. True
b) MS-ACCESS is a spread-sheet software. False
c) Index decreases the speed of the query and short operations. False
d) The data in primary key field need to be unique and not null. True
9. Match the following:
Group A Group B
i) MS-ACCESS a) analyze and present data in a printed format
ii) Data update b) Query
iii) Field c)
a piece of information related to someone or something
iv) Report d)
Database management software
e)
collection of related fields.
Ans:
Group A Group B
i) MS-ACCESS - a) Database management software
ii) Data update - b) Query
iii) Field - c) a piece of information related to someone or something
iv) Report - d) analyze and present data in a printed format
Group C
Programming(18 marks)
10. a) Define modular
programming.
Ans: Modular programming is a technique in which a program is divided into different small manageable program blocks, which are called modules or sub programs.
b) Name any two data types used in C language.
Ans: Any two data types of C language are:
· char
· int
c) Give the functions of NAME and CLOSE
statements.
Ans:
NAME: The function of NAME statement is to rename a
file on a diskette
CLOSE: The function of CLOSE statement is to close one
or all open files.
11.
Re-write the given program correcting the bugs:
DECLARE SUB Series()
CLS
EXECUTE Series
END
SUB Series
A=2
B=2
FOR ctr= 1 to 5
DISPLAY A;B;
A=A+B
B=A+B
LOOP ctr
END Series()
Ans:
DECLARE SUB Series ( )
CLS
CALL Series
END
SUB Series
A=2
B=2
FOR ctr= 1 to 5
PRINT A;B;
A=A+B
B=A+B
NEXTctr
END SUB
12. Write the output of the following program.
DECLARE FUNCTION Interest(p,t,r)
CLS
LET p=30
LET t=40
LET r=6
LET d=Interest(p,t,r)
PRINT “The simple interest will be”; d
END
FUNCTION Interest(p,t,r)
answer = (p*t*r)/100
Interest=answer
END FUNCTION
13. Analyse the program given below and answer the questions:
DECLARE FUNCTION Diff(A,B)
CLS
INPUT “Enter first number”;A
INPUT “Enter second number”;B
PRINT “The difference of the two number=”;Diff(A,B)
END
FUNCTION Diff(A,B)
D=A-B
Diff=D
END FUNCTION
a) What will be the output of the program if the user enters 200 as the first number and 100 as the second number?
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.
14.a) Write a program using FUNCTION….END FUNCTION to get a word from the user and print the word in the reverse order.
Ans:
DECLARE FUNCTION REV$(S$)
CLS
INPUT “Enter any word”; S$
PRINT “The reverse word is”; REV$(S$)
END
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
b) Write a program using SUB….END SUB to get radius of the circle and display the area.
Ans:
DECLARE SUB AREA(R)
CLS
CONST PI=3.1416
INPUT ”Enter radius”; R
CALL AREA(R)
END
SUB AREA(R)
A=PI*R^2
PRINT “The area of circle”; A
END
c) A sequential data file called “Marks.dat” contains roll number, name, English, Nepali, and Maths field. Write a program to display all the content of the data file.
Ans:
OPEN “MARKS.DAT” FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
INPUT #1, RN, N$, E, N, M
PRINT RN, N$, E, N, M
WEND
CLOSE #1
END
***
Solved SLC Supp. Computer Science 2066
Supplementary Examination 2066
Group A
Computer Fundamentals (22 marks)
1. Answer the following questions:
a) What is bandwidth?
Ans: The data handling capacity of a communication system is known as bandwidth.
b) What is network topology?
Ans: The arrangement or connection pattern of computers or nodes and other devices of the network is known as network topology.
c) How can multimedia help in education?
Ans: Multimedia technology is very much useful in education. It helps to present the information about various topics in more interesting and interactive way which makes the learner easy to understand. It helps to give better ideas and concept to the students with good vocabulary.
d) Write any four safety measures to protect computer form virus.
Ans: Any four safety measures to protect computer from viruses are:
i. Write-protect your floppy disk when using them on
other computers.
ii. Do not install pirated software, especially computer
games.
iii. Always scan files downloaded from the internet or
transferred over the network before executing them.
iv. Do not interchange internal disk among the computers.
e) What is computer hardware and software security?
Ans: The security given to various hardware tools and equipment from being lost or damaged due to accidental or intentional harm is known as hardware security. For e.g: protection from theft, power protection device, etc.
The security given to various software and data from being lost or damaged due to accidental or intentional harm is known as software security. For e.g: defragmentation, scan disk, etc.
3. Match the following
Group A Group B
i) Bandwidth a) ISP
ii) Internet b) FAT
iii) Network c) bps
iv) Software security d) NAV
e) NIC
Ans:
Group A Group B
i) Bandwidth - a) bps
ii) Internet - b) ISP
iii) Network - c) NIC
iv) Software security - d) NAV
4. Choose the correct answer:
a) Which is NOT a guided media?
i) UTP Cable ii) STP Cable iii) Satellite iv) Fiber Optics
Ans: Satellite
b) Which device is necessary to operate internet?
i) CD-ROM ii) ISP iii) MODEM iv) All of the above
Ans: MODEM
c)Modem converts
i) Sound into digital ii) Digital into sound iii) Both i) and ii)
iv) None
Ans: Both i) and ii)
d) Which is not an internet service?
i) e-mail ii) e-telephone iii)e-fax iv) e-commerce
Ans: e-telephone
5. Write the technical terms of the following:a) Making extra copies of data or program.
Ans: Backup
b) A card used to connect network cable to computer.
Ans: NIC (Network Interface Card)
c) Device used for power protection.
Ans: Volt guard
d) Program used to detect and eliminate computer virus.
Ans: Anti-virus
6. Write the full forms of:a) WWW- World Wide Web
b) UPS- Uninterruptible Power Supply
c) NOS- Network Interface Card
d) UTP- Unshielded Twisted Pair
Group B
Database (10 marks)
Database (10 marks)
7. Answer the following questions:
a) Define database.
Ans: Database is a collection of related and organized information that is used to store, organize and extract data.
b) Write any four data type used in MS-Access.
Ans: Any four data types used in MS-Access are as follows:
i. Number
ii. Text
iii. Memo
iv. Autonumber
c) What is query?
Ans: Query is an object of MS-Access which allows selecting specific data from one or more tables.
8. State whether the following statements are true or false:a) Primary key does not accept null value. True
b) The extension of database file created by MS-Access is .BDF. False
c) Memo data type cannot be indexed. True
d) The default size of text data type is 50.True
9. Match the following: Group A Group B
a) OLE i) Formatted output
b) Primary key ii) Interface
c) Form iii) 64,000 characters
d) Report iv) Unique Field
v) Picture
Ans:
Group A Group Ba) OLE - Picture
b) Primary key - Unique Field
c) Form - Interface
d) Report - Formatted output
Group C
Programming (18 marks)
Programming (18 marks)
10. a) What is user defined function?
Ans: The function which is defined by the user according to the need is known as user-defined function.
b) List any two data types used in C language.
Ans: The data types used in C language are:
· Char
· Int
c) Write down the function of the following statements:
i) KILL ii) FILES
Ans: The function of:
i. KILL: It deletes the file or files from the specified
drive and directory.
ii. FILES:
It displays all the files of the current subdirectory or specified sub
directory.
11. Write the output of the given program: DECLARE SUB Result
CALL Result
END
SUB Result
For I = 1 to 9 STEP 2
Sum=Sum +I^2
Next I
PRINT Sum
END SUB
12. Rewrite the following program after correcting the bugs:REM to store Name, post and salary
OPENEMP.DOCFOROUTAS#1
INPUT “Enter Name”; N
INPUT “Enter post”; P$
INPUT “Enter salary”; S
WRITE #2, N$,P$,S
CLOSE #1
END
Ans:
REM to store Name, post and salary
OPEN “EMP.DOC” FOR OUTPUT AS #1
INPUT “Enter Name”; N$
INPUT “Enter post”; P$
INPUT “Enter salary”; S
WRITE #1, N$,P$,S
CLOSE #1
END
13. Study the following program and answer the following questions:
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
a) List the string Library functions used in the above program.
Ans: The string Library functions used in the above program are as follows:
· LEN
· MID$
· UCASE$
b) 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$).
14. a) Write a program using FUNCTION…..END FUNCTION to find the average of any two numbers given by the user.
Ans:
DECALRE FUNCTION AVE(A,B)
CLS
INPUT “Enter any two numbers”; A,B
PRINT “The average of two numbers=”; AVE(A,B)
END
FUNCTION AVE(A,B)
AV=(A+B)/2
AVE=AV
END FUNCTION
b) Write a program using SUB……END SUB to check whether the number given by the user is positive or negative.
Ans:
DECLARE SUB CHECK(N)
CLS
INPUT ”Enter any number”; N
CALL CHECK(N)
END
SUB CHECK(N)
IF N>0 THEN
PRINT N;”is positive number”
ELSEIF N<0 THEN
PRINT N;”is negative number”
END IF
END SUB
c) A data file “LIB.TXT” consists of book’s name, author’s name and price of books. Write a program to count and display the total number of records present in the file.
Ans:
OPEN “LIB.TXT” FOR INPUT AS #1
CLS
WHILE NOT EOF(1)
INPUT #1, N$, A$, P
C=C+1
WEND
PRINT “The total number of records=”; C
CLOSE #1
END
***
No comments:
Post a Comment