Group ‘A’ Very Short Answer [10×1=10]
1. Answer the following questions in one sentence: [6×1=6]
1. What is internet?
Ans: The internet is a global network of interconnected computers that communicate using standardized protocols to share information and resources.
2. What is cloud computing?
Ans: Cloud computing is the delivery of computing services such as storage, processing, and software over the internet, allowing for on-demand access and scalability.
3. Which data type is used to store salary of an employee in MS-Access?
Ans: The Currency data type is used to store the salary of an employee in MS-Access.
4. What is an extension of MS-Access database?
Ans: The extension of an MS-Access database is .accdb.
5. What are modules in QBASIC?
Ans: Modules in QBASIC are blocks of code or procedures that can be called from other parts of the program to perform specific tasks.
6. Write any two data type used in C language.
Ans: Two data types used in C language are int and float.
2. Write appropriate technical term for the following: [2×1=2]
1. The rate at which data are transferred in a given medium
Ans: Bandwidth
2. The use of computer technology to create a simulated environment.
Ans: Virtual Reality (VR)
3. Write the full form of the following: [2×1=2]
SMTP, CDMA
Ans: SMPT: Simple Mail Transfer Protocol
CDMA: Code Division Multiple Access
Group ‘B’ Short Answer [12×2=24]
4. Answer the following questions: [9×2=18]
1. Differentiate between bus and star topology with figure.
Ans: Bus topology connects all devices in a linear sequence with a single central cable (bus), whereas star topology connects all devices to a central hub or switch, forming a star-like structure.
2. What is computer crime? Give any four example of it.
Ans: Computer crime, also known as cybercrime, refers to illegal activities conducted using computers or networks. Four examples are hacking, phishing, identity theft, and the spread of malware.
3. What is hardware security? Write any two measures of software security.
Ans: Hardware security involves protecting physical computer systems from damage and unauthorized access. Two measures of software security are using antivirus programs and implementing strong, unique passwords.
4. What is E-Commerce? Write its importance.
Ans: E-Commerce, or electronic commerce, is the buying and selling of goods and services over the internet. Its importance includes enabling businesses to reach a global audience, reducing operational costs, and providing convenience to consumers.
5. What is mobile computing? Write any two importance of it.
Ans: Mobile computing is the ability to use computing capabilities on the move, typically through devices like smartphones and tablets. Its importance includes increased accessibility to information and the ability to perform tasks from virtually anywhere.
6. Differentiate between database and DBMS with example.
Ans: A database is an organized collection of data, whereas a DBMS (Database Management System) is software that interacts with users, applications, and the database itself to capture and analyze data. For example, an Excel spreadsheet is a database, while Microsoft Access is a DBMS.
7. What is primary key? List any two advantages of it.
Ans: A primary key is a unique identifier for records in a database table. Two advantages are ensuring each record is unique and improving data retrieval speed.
8. What is data sorting? List any two advantages of using it.
Ans: Data sorting is the process of arranging data in a specific order, such as ascending or descending. Two advantages are easier data analysis and faster search and retrieval of information.
9. Define query? Write its importance.
Ans: A query is a request for data or information from a database. Its importance lies in its ability to filter, sort, and retrieve specific data efficiently from large datasets.
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 Table:
Iteration | I | A (Initial) | B (Initial) | A (New) | B (New) | 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: Here is the corrected version of the program:
REM to store record in data file
CLS
OPEN "info.dat" FOR APPEND AS #1
DO
INPUT "Enter Name: ", N$
INPUT "Enter Address: ", A$
INPUT "Enter Class: ", 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
1. What is the main objective of the program given above?
Ans: The main objective of the program is to reverse the input string entered by the user.
2. List all the parameters used in above program.
Ans: The parameters used in the program are N$
(the input string passed to the function) and X$
(the input string entered 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:
1. Convert (1110001110)2 to (?)8To convert binary (base-2) to octal (base-8), group the binary digits into sets of three, starting from the right.
Binary: 1 110 001 110
| | | |
Octal: 1 6 1 6
So, (1110001110)2 = (1616)8
2. Convert (111)10 to (?)2
To convert from decimal (base-10) to binary (base-2), divide the number by 2 and write down the remainder. Continue dividing the quotient by 2 until you get a quotient of 0.
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
Read the remainders from bottom to top: 1101111
So, (111)10 = (1101111)2
3. Calculate (1000)2 – (111)2
To subtract binary numbers, align them and perform binary subtraction.
1000
- 0111
------
0001
So, (1000)2- (111)2= (1)2
4. Calculate (111111)2 ÷ (111)2 To divide binary numbers, perform binary division similar to decimal division.
1001
------
111 ) 111111
111
----
000
000
----
0000
0000
----
0000
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: QBASIC Program to Calculate Area and Circumference of a Circle:
DECLARE FUNCTION CalculateArea (radius)
DECLARE SUB CalculateCircumference (radius)
CLS
INPUT "Enter the radius of the circle: ", radius
PRINT "The area of the circle is: "; CalculateArea(radius)
CALL CalculateCircumference(radius)
END
FUNCTION CalculateArea (radius)
CalculateArea = 3.14159 * radius * radius
END FUNCTION
SUB CalculateCircumference (radius)
circumference = 2 * 3.14159 * radius
PRINT "The circumference of the circle is: "; circumference
END SUB
9.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: QBASIC Program to Display Information of Female Students Who Pass in All Subjects:
OPEN "Record.txt" FOR INPUT AS #1
CLS
PRINT "Female Students Who Passed in All Subjects"
PRINT "------------------------------------------"
DO WHILE NOT EOF(1)
INPUT #1, RollNo, Name, Gender, English, Nepali, Maths, Computer
IF Gender = "F" AND English >= 40 AND Nepali >= 40 AND Maths >= 40 AND Computer >= 40 THEN
PRINT "Roll No: "; RollNo; " Name: "; Name; " Gender: "; Gender
PRINT "English: "; English; " Nepali: "; Nepali; " Maths: "; Maths; " Computer: "; Computer
PRINT
END IF
LOOP
CLOSE #1
END
10. Write a program in C language to convert days into respective years, months and days[4]
Ans: C Program to Convert Days into Years, Months, and Days:
#include <stdio.h>
int main() {
int totalDays, years, months, days;
printf("Enter the number of days: ");
scanf("%d", &totalDays);
years = totalDays / 365;
totalDays = totalDays % 365;
months = totalDays / 30;
days = totalDays % 30;
printf("Years: %d, Months: %d, Days: %d\n", years, months, days);
return 0;
}
OR
Write a program in ‘C’ language to input two number and find greatest among two number.
Ans: C Program to Find the Greatest of Two Numbers:
#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;
}