Group ‘A’ – 10 marks
1.Answer the following questions in one sentence: [6×1=6]
a. What is search engine?
Ans: Search engine is a web application which allows user to search the content from the internet based in their queries. E.g. Google, Bing
b. What is the business done through the internet?
Ans: E-Commerce is the business done through the internet
c. Which data type is used to store numeric characters or special symbols in MS-Access?
Ans: “Text” data type is used to store numeric characters or special symbols in MS-Access
d. Which view is used to modify a table in MS-Access?
Ans: Design view is used to modify a table in MS-Access.
e. What is Modular Programming?
Ans: The process of breaking down a large program into smaller logical and manageable part is called modular programming.
f. Write any two features of C language.
Ans: Two features of C language are :
- It is structural programming language.
- It supports graphics.
2. Write appropriate technical term for the following: [2×1 =2]
a. Law that governs the legal issues of cyberspace.
Ans: [Cyber Law]
b. The smallest unit to represent information on quantum computer.
Ans: [Quantum Bit]
3. Write the full form of the following: [2×1=2]
I. STP: Shielded Twisted Pair
II. WAP: Wireless Application Protocol
Group ‘B’ – 24 marks
4. Answer the following questions: [9×2=18]
a. What is computer network? Enlist any two advantages of it.
Ans: A group of computers interconnected with each other through any medium using definite rule(protocol) for the purpose of sharing data, information, hardware, software and other resources. The advantages are:
- Expensive hardware like printer, scanner etc can be shared in a network. So, it is cost effective.
- It allows several user to share data in real time.
b. What is computer ethics? Write any two of them.
Ans: Computer ethics are the moral code of conduct or set of principles that guides computer user about the wise and safe use of computers and other electronic media. It generally aware computer user from misuse and exploitation of technology.
- Don’t use computer and internet to commit crime (cyber crime).
- Use computer to share and gain knowledge.
c. What is software security? Write any two measures of hardware security.
Ans: The protection or securing computer data, information and software from being damaged or lost accidentally or intentionally is known as software security.
The two measures of hardware security are:
- Use power protection device like UPS, volt guard, CVT.
- Maintain dust free environment.
d. What is m-Commerce? Write its two important services.
Ans: M-Commerce refers to Mobile-Commerce which is an extended version of E-Commerce where buying and selling goods, services and information are done through handheld devices like mobile phone, tablets, PDAs etc. E.g. movie tickets, flight ticket. The two important services are:
- Mobile banking
- Hotel Booking
e. What is IoT? Write any two importance of it.
Ans: IoT (Internet of Things) is the network of real world “Things” (Devices) made with sensors, software, hardware and other various modern technology that can communicate with the user and devices along with its environment. E.g. smart watch, voice assistant, smart car. Its importance are:
- It increase efficiency and productivity of work.
- It helps to automate our daily life work.
f. What is database ? Give any two examples.
Ans: The systematic and scientific collection of data that can be retrieved or access whenever required is called database. It is the organized way of collecting and keeping data and information. E.g. Dictionary, Telephone directory, Marks ledger etc.
g. What is primary key? List any two advantages of it.
Ans: The key or field that is used to uniquely identify records from the database table is called primary key. It must be unique and cannot be kept empty(null value not accepted)
Its importance are:
- It uniquely identifies records.
- It prevents duplication of data.
- It helps in faster searching of records.
h. What is data sorting? List any two advantages of using it.
Ans: Arranging data in a particular order of field that may be either ascending or descending is called data sorting. The process of placing elements from a collection in some kind of order is sorting. Its advantages are:
- Similar data can be grouped together.
- It helps in faster searching of data.
i. What types of work is done in MS-Access using Form and query object?
Ans: Form allows user to enter new data and edit or modify the existing data through user friendly interface. Query allows user to retrieve or access and interpret the information based on the user requirements.
5. Write down the output of the given program. Show with dry run in table. [2]
DECLARE SUB SHOW (A)
CLS
N = 87
CALL SHOW (N)
END
SUB SHOW (A)
DO
B = A MOD 6 + 3
IF B MOD 4 = 0 THEN
GOTO AA
PRINT B;
AA:
A = A - 10
LOOP WHILE A >= 50
END SUB
Ans:
Dry run in table | ||||
A | N | B = A MOD 6+3 | Condition(B MOD 4 = 0) | |
– | 87 | – | – | |
87 | 87 | – | – | |
1st loop | 77 | 87 | 6 | false |
2nd loop | 67 | 87 | 4 | true |
3rd loop | 57 | 87 | 6 | false |
4th loop | 47 | 87 | 8 | true |
Output is: 6 6
6. Re-write the given program after correcting the bugs: [2]
REM to add record in an existing file
CLS
OPEN “Record.Dat” FOR OUTPUT AS #1
AA:
INPUT “Enter Name, Class and Roll No. “; Nm$, Cl, Rn
INPUT #2, Nm$, Cl, Rn
INPUT “More records “; Y$
IF UCASE$(Y$) = “Y” THEN
GOTO aa
CLOSE “Record.dat”
END
Ans: Program after correcting bugs is:
CLS
OPEN “Record.Dat” FOR APPEND AS #1
AA:
INPUT “Enter Name, Class and Roll No. “; Nm$, Cl, Rn
WRITE #1, Nm$, Cl, Rn
INPUT “More records “; Y$
IF UCASE$(Y$) = “Y” THEN
GOTO aa
CLOSE #1
END
7. Study the following program and answer the given questions: [2]
OPEN “Detail.dat” FOR INPUT AS #1
OPEN “Temp.dat” FOR OUTPUT AS #2
INPUT “Enter name of the students “; Sn$
FOR I = 1 TO 10
INPUT #1, Nm$, Cl, A
IF Sn$ < > Nm$ THEN
WRITE #2, Nm$, Cl, A
END IF
NEXT I
CLOSE #1, #2
KILL “Detail.dat”
NAME “Temp.dat” AS “Detail.dat”
END
- What is the main objective of the program given above?
Ans: The main objective of given program is to delete the record associated with the name entered by the user.
- Do you get any problem in the above program if “Kill” statement is removed? Give reason.
Ans: Since, KILL statement will delete datafile named “detail.dat”, if we removed KILL the new data file “temp.dat” will be not renamed as “detail.dat”
Group ‘C’ [4×4=16]
8. Convert / calculate as per the instruction: [4]
- (11001101)2 = (?)16
- (524)10 = (?)2
- (1010)2 x (110)2 – (1011)2 = (?)2
- (10110)2 ÷ (101)2
Ans:
1. Convert (11001101)2to hexadecimal ((?)16:
First, let’s group the binary digits into sets of four, starting from the right: 1100 11011100 1101
Now, convert each group to its hexadecimal equivalent:
- 11001100 in binary is 1212 in decimal, which is 𝐶C in hexadecimal.
- 11011101 in binary is 1313 in decimal, which is 𝐷D in hexadecimal.
Thus, (11001101)2=(𝐶𝐷)16(11001101)2=(CD)16.
2. Convert (524)10 to binary ((?)2):
To convert from decimal to binary, we repeatedly divide by 2 and record the remainders.
524 ÷ 2 = 262 remainder 0
262 ÷ 2 = 131 remainder 0
131 ÷ 2 = 65 remainder 1
65 ÷ 2 = 32 remainder 1
32 ÷ 2 = 16 remainder 0
16 ÷ 2 = 8 remainder 0
8 ÷ 2 = 4 remainder 0
4 ÷ 2 = 2 remainder 0
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1
Reading the remainders from bottom to top, (524)10=(1000001100)2(524)10=(1000001100)2.
3. Calculate (1010)2×(110)2−(1011)2:
First, let’s perform the multiplication: (1010)2×(110)2(1010)2×(110)2
Convert to decimal to make multiplication easier:
- (1010)2=10(1010)2=10 in decimal.
- (110)2=6(110)2=6 in decimal.
Now, multiply the decimal numbers: 10×6=6010×6=60
Convert 6060 back to binary: 60 ÷ 2 = 30 remainder 0
30 ÷ 2 = 15 remainder 0
15 ÷ 2 = 7 remainder 1
7 ÷ 2 = 3 remainder 1
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Thus, 6010=(111100)26010=(111100)2.
Now, subtract (1011)2(1011)2 from (111100)2(111100)2: First, align the numbers: 111100111100 −001011−001011
Perform binary subtraction: 111100−001011=110001111100−001011=110001
So, (1010)2×(110)2−(1011)2=(110001)2(1010)2×(110)2−(1011)2=(110001)2.
4. Perform the division (10110)2÷(101)2:
Convert the numbers to decimal:
- (10110)2=22(10110)2=22 in decimal.
- (101)2=5(101)2=5 in decimal.
Now, divide the decimal numbers: 22÷5=4 remainder 222÷5=4 remainder 2
Convert the quotient and remainder back to binary:
- 410=(100)2410=(100)2
- 210=(10)2210=(10)2
Thus, the division (10110)2÷(101)2=(100)2(10110)2÷(101)2=(100)2 with a remainder of (10)2(10)2.
In summary:
- (11001101)2=(𝐶𝐷)16
- (524)10=(1000001100)2
- (1010)2×(110)2−(1011)2=(110001)2
- (10110)2÷(101)2=(100)2 with a remainder of (10)2.
9. a. Write a program in QBASIC that asks length, breadth and height of room and calculates its area and volume. Create a user-defined function to calculate area and sub-program to calculate volume. Hint: [A = LxB], [V = LxBxH] [4]
Ans:
DECLARE FUNCTION area(l, b)
DECLARE SUB volume(l, b, h)
CLS
INPUT “Enter length breadth and height”, l, b, h
x=area(l, b)
PRINT “Area is”; x
CALL volume(l, b, h)
END
FUNCTION area(l, b)
a=l*b
area=a
END FUNCTION
SUB volume(l, b, h)
v=l*b*h
PRINT “Volume is”; v
END SUB
b. A sequential data file called “Record.txt” has stored data under the field heading Roll No., Name, Gender, English, Nepali, Maths and Computer. Write a program to display all the information of those students whose gender is ‘F’ and obtained marks in computer is more than 90. [4]
Ans:
OPEN “Record.txt” FOR INPUT AS #1
CLS
PRINT “Roll No”, “Name”, “Gender”, “English”, “Nepali”, “Maths”, “Computer”
WHILE NOT EOF(1)
INPUT #1, r, n$, g$, e, n, m, c
g$ = UCASE$(g$)
IF g$ = “F” AND c>90 THEN
PRINT r, n$, g$, e, n, m, c
END IF
WEND
CLOSE #1
END
10. Write a program in C language that asks a number and check whether it is odd or even. [4]
Ans:
#include
int main( )
{
int n, a;
printf(“Enter any number”);
scanf(“%d”, &n);
a = n%2;
if (a == 0)
{
printf(“%d is even”, n);
}
else
{
printf(“%d is odd”, n);
}
return 0;
}
OR
Write a program in ‘C’ language to display the series with their sum. 1,2,3,4,….., up to 10th terms.
Ans:
#include
int main( )
{
int i, s=0;
for(i=1; i<=10; i++)
{
printf(“%d”, i);
s = s+i;
}
printf(“Sum is %d”, s);
return 0;
}