Group – “A” ( 10 X 1 = 10 )
1. Answer the following questions:[6]
a. Write any two popular search engines.
Ans: Google and Bing.
b. What is social media?
Ans: Social media refers to websites and applications that enable users to create, share content, and participate in social networking.
c. Which query is used to view the data stored in database.?
Ans: The SELECT query is used to view the data stored in a database.
d. Name any two data type that can be defined in MS- Access.
Ans: Text and Number.
e. Write down one difference between function and sub procedure.
Ans: A function returns a value, whereas a sub procedure does not return a value.
f. Write any two advantages of structured programming.
Ans: Structured programming enhances code readability and maintainability, and it makes debugging and testing easier.
2. Write appropriate technical term for the following: [2]
a. Crimes committed using electronics devices and cyber space.
Ans: Cybercrime.
b. A program that can disinfect a file from virus.
Ans: Antivirus software.
3. Write the full form of the following:[2]
a. STP: Shielded Twisted Pair.
b. WAP: Wireless Application Protocol.
Group – “B”
4. Answer the following questions: [9 X 2 = 18 ]
a. Differentiate between bus and star topology.
Ans: In Bus topology all devices share a single communication line or bus, which can lead to collisions whereas in star topology all devices are connected to a central hub, which reduces the risk of collisions and makes troubleshooting easier.
b. What is computer crime? Give any four example of it.
Ans: Computer crime is illegal activity that involves a computer or network.
Examples: Hacking, phishing, identity theft, and spreading malware.
c. What is hardware security? Write any two measures of software security.
Ans: Hardware security refers to the protection of physical devices from theft or damage.
Two measures of software security: Installing antivirus software and using firewalls.
d. What is E-Commerce? Write its importance.
Ans: E-Commerce is the buying and selling of goods and services over the internet.
Importance: It provides a global marketplace, reduces operational costs, and offers convenience for customers.
e. What is mobile computing? Write any two importance of it.
Ans: Mobile computing involves the use of portable computing devices, such as smartphones and tablets, to access and process information.
Importance: Enables access to data and applications anytime and anywhere, and enhances productivity through mobility.
f. Differentiate between database and DBMS with example.
Ans: A database is an organized collection of data (e.g., a library catalog)whereas a DBMS (Database Management System) is software that manages databases and allows users to create, read, update, and delete data (e.g., MySQL, Oracle).
g. What is primary key? List any two advantages of it.
Ans:
h. What is data sorting? List any two advantages of using it.
Ans: A primary key is a unique identifier for a record in a database table.
Two advantages: Ensures each record is unique and improves data retrieval speed.
i. Define query? Write its importance.
Ans: A query is a request for data or information from a database.
Importance: Queries allow users to retrieve specific data, perform calculations, and generate reports based on the criteria set.
5. Write down the output of the given program. Show with dry run in table. [2]
DECLARE SUB SHOW (A,B)
CLS
X=1 : Y=2
CALL SHOW (X,Y)
END
SUB SHOW (A ,B)
I=1
DO
PRINT A;
A=A+B
B=A+B
I=I+1
LOOP WHILE I <= 5
END SUB
Ans:
Dry Run:
Step | I | A (Initial) | B (Initial) | A (Updated) | B (Updated) | Output |
---|---|---|---|---|---|---|
1 | 1 | 1 | 2 | 3 | 5 | 1 |
2 | 2 | 3 | 5 | 8 | 13 | 3 |
3 | 3 | 8 | 13 | 21 | 34 | 8 |
4 | 4 | 21 | 34 | 55 | 89 | 21 |
5 | 5 | 55 | 89 | 144 | 233 | 55 |
Output:
1 3 8 21 55
6. Re-write the given program after correcting the bugs: [2]
REM to store record in data file
CLS
OPEN “info.dat” FOR INPUT AS #1
DO
INPUT “Enter Name, address and class “; N$, A, C
INPUT #1, N$, A, C
INPUT “Do you want to continue “; Y$
WHILE UCASE$(Y$) = “Y”
CLOSE “info.dat”
END
Ans: Corrected Program:
REM to store record in data file
CLS
OPEN "info.dat" FOR OUTPUT AS #1
DO
INPUT "Enter Name, address and class "; N$, A$, C$
WRITE #1, N$, A$, C$
INPUT "Do you want to continue (Y/N)"; Y$
LOOP WHILE UCASE$(Y$) = "Y"
CLOSE #1
END
7. Study the following program and answer the given questions: [2]
DECLARE FUNCTION text$(N$)
CLS
INPUT “Enter any string”;X$
PRINT text$(X$)
END
FUNCTION text$(N$)
FOR i=len (N$) TO 1 STEP -1
W$=W$+MID$(N$,I,1)
NEXT i
text$ = W$
END FUNCTION
a. What is the main objective of the program given above?
Ans: The main objective of the program is to reverse the input string provided by the user.
b. List all the parameters used in above program.
Ans:
N$
(the string input to thetext$
function)I
(the loop counter)W$
(the string that accumulates the reversed characters)X$
(the string input by the user)
Group ‘C’ Long Answer [4×4=16]
8.Convert / calculate as per the instruction: [4×1=4]
- (1110001110)2 = (?)8
- (111)10 = (?) 2
- (1000) 2 – (111) 2 = (?) 2
- (111111) 2 ÷ (111) 2
Ans:
8. Convert / calculate as per the instruction: [4×1=4]
- ((1110001110)2 to ((?)8
Ans:
First, group the binary number into sets of three digits, starting from the right:
[ (001)(110)(001)(110) ]
Convert each group to its octal equivalent:
- (001)2 =(1)8
- (110)2 = (6)8
- (001)2 = (1)8
- (110)2 = (6)8
So, ((1110001110)2 = (1616)8
- ((111)_{10}) to ((?)_2)
Ans:
111÷2=55 remainder 1
55÷2=27 remainder 1
27÷2=13 remainder 1
13÷2=6 remainder 1
6÷2=3 remainder 0
3÷2=1 remainder 1
1÷2=0 remainder 1
Reading the remainders from bottom to top, ((111)10 = (1101111)2.
- ((1000)2 – (111)2 = (?)2
Ans:
First, align the numbers for subtraction:
1000
-0111
0001
So, ((1000)2 – (111)2 = (1)2.
- ((111111)2 / (111)2
Ans:
Convert both numbers to decimal:
- (111111)2=1⋅2^5+1⋅2^4+1⋅2^3+1⋅2^2+1⋅2^1+1⋅2^0=32+16+8+4+2+1=63
- (111)2= 1⋅2^2+1⋅2^1+1⋅2^0=4+2+1=7
Now, divide the decimal numbers:
63÷7=9
Convert (9) back to binary:
(9)10 = (1001)2
So, ((111111)2 / (111)2 = (1001)2.
9. a. Write a program in QBASIC to input radius of circle and calculate its area using function and circumference using sub procedure [ Area=pr2 and Circumference= 2pr] [4]
Ans: program in QBASIC to input radius of circle and calculate its area using function and circumference using sub procedure
DECLARE FUNCTION Area(R)
DECLARE SUB Circumference(R)
CLS
INPUT "Enter the radius of the circle: ", R
PRINT "Area of the circle: "; Area(R)
CALL Circumference(R)
END
FUNCTION Area(R)
PI = 3.14159
Area = PI * R * R
END FUNCTION
SUB Circumference(R)
PI = 3.14159
C = 2 * PI * R
PRINT "Circumference of the circle: "; C
END SUB
b. A sequential data file called “Record.txt” has stored data under the field heading Roll No., Name, Gender, English, Nepali, Math’s and Computer. Write a program to display all the information of female students who pass in all subjects.[Note: Pass mark in all subject is 40] [4]
Ans: Program to display all information of female students who pass in all subjects from “Record.txt”
CLS
OPEN "Record.txt" FOR INPUT AS #1
PRINT "Roll No.", "Name", "Gender", "English", "Nepali", "Math", "Computer"
PRINT "------------------------------------------------------------"
DO WHILE NOT EOF(1)
INPUT #1, RollNo, Name$, Gender$, English, Nepali, Math, Computer
IF Gender$ = "F" AND English >= 40 AND Nepali >= 40 AND Math >= 40 AND Computer >= 40 THEN
PRINT RollNo, Name$, Gender$, English, Nepali, Math, Computer
END IF
LOOP
CLOSE #1
END
10. Write a program in C language to convert days into respective years, months and days. [4]
Ans: program in C language to convert days into respective years, months and days.
#include <stdio.h>
int main() {
int days, years, months, remaining_days;
printf("Enter the number of days: ");
scanf("%d", &days);
years = days / 365;
remaining_days = days % 365;
months = remaining_days / 30;
remaining_days = remaining_days % 30;
printf("%d days is equivalent to %d years, %d months, and %d days.\n", days, years, months, remaining_days);
return 0;
}
OR
Write a program in ‘C’ language to input two number and find greatest among two number.
Ans:
#include <stdio.h>
int main() {
int num1, num2;
printf("Enter the first number: ");
scanf("%d", &num1);
printf("Enter the second number: ");
scanf("%d", &num2);
if (num1 > num2) {
printf("The greatest number is: %d\n", num1);
} else if (num2 > num1) {
printf("The greatest number is: %d\n", num2);
} else {
printf("Both numbers are equal.\n");
}
return 0;
}