Group – “A” ( 10 X 1 = 10 )
1. Answer the following Questions in one sentence: [ 6 X 1 = 6]
a. What is network protocol?
Ans: A network protocol is a set of rules and conventions that determine how data is transmitted and received over a network.
b. What is antivirus software ?
Ans: Antivirus software is a program designed to detect, prevent, and remove malware from computers and networks.
c, What is the default size of text field in MS – Access?
Ans: The default size of a text field in MS Access is 255 characters.
d. Which data type is used to store photo in MS – Access?
Ans: The data type used to store a photo in MS Access is OLE Object or Attachment.
e. What is looping?
Ans: Looping is a programming construct that repeats a sequence of instructions until a specific condition is met.
f. Write any Two features of C language.
Ans: Two features of C language are its simplicity and efficiency, and its support for low-level memory manipulation.
2. Write appropriate technical term for the following: [2]
a. Law that govern the legal issues of cyberspace.
Ans: Cyberlaw.
b. The smallest unit to present information on quantum computer.
Ans: Qubit.
3. Write the full form of the following:[2]
a. UTP: Unshielded Twisted Pair.
b. IoT: Internet of Things.
Group – “B”
4. Answer the following questions: [9 X 2 = 18]
a. Write any two advantages and disadvantages of computer network.
Ans:
Advantages: Facilitates resource sharing and enables communication between devices.
Disadvantages: Increases security risks and can lead to network congestion.
b. What is computer ethics? Write any two ethics of it.
Ans: Computer ethics is the study of moral principles and guidelines governing the use of computers and technology.
Two ethics: Respect privacy and avoid unauthorized access to other people’s data.
c. What is computer security? Write any two hardware security measures.
Ans: Computer security refers to the protection of computer systems and information from harm, theft, and unauthorized use.
Two hardware security measures: Use of biometric authentication and hardware firewalls.
d. Give two difference between E – commerce and Traditional commerce.
Ans:
E-commerce: Transactions are conducted online and accessible 24/7.
Traditional commerce: Transactions are conducted in physical locations with limited operating hours.
e. Define AI. Write any two uses of AI.
Ans: AI (Artificial Intelligence) is the simulation of human intelligence in machines designed to think and learn.
Two uses: Autonomous vehicles and personalized recommendations in e-commerce.
f. What is RDBMS? Write any two examples of it.
Ans: RDBMS (Relational Database Management System) is a database management system based on the relational model.
Two examples: MySQL and Oracle Database.
g. What is report in MS – Access ? Mention the importance of report in database.
Ans: A report in MS Access is a formatted printout or display of data from a database.
Importance: Reports allow for the organized presentation and analysis of data, making it easier to understand and share insights.
h. What is data sorting? List any two advantages of using it.
Ans: Data sorting is the process of arranging data in a specific order, typically ascending or descending.
Two advantages: Facilitates quicker data retrieval and improves readability and analysis.
i. List the field name and record used in the following table structure.
Field Names:
- symbol no.
- name
- Marks
Records:
- Record 1:
- symbol no.: 001009010
- name: Hari Thapa
- Marks: 85
- Record 2:
- symbol no.: 0010090
- name: Binu Sharma
- Marks: 91
5. Write the output of the given program. Show with dry run in table.[2]
DECLARE SUB ABC(A)
CLS
A=2
CALL ABC(A)
END
SUB ABC
FOR J=1 TO 5
PRINT A;
A=A+3;
NEXT J
END SUB
Ans:
Dry Run:
Step | J | A (Initial) | A (Updated) | Output |
---|---|---|---|---|
1 | 1 | 2 | 5 | 2 |
2 | 2 | 5 | 8 | 5 |
3 | 3 | 8 | 11 | 8 |
4 | 4 | 11 | 14 | 11 |
5 | 5 | 14 | 17 | 14 |
Output:
2 5 8 11 14
6. Re – write the given program after correcting the bug:[2]
DECLARE SUB Series()
CLS
EXECUTE Series
END
SUB Series()
REM Program to generate 1 1 2 3 5 ..... upto the 20th terms
A=1
B=1
FOR ctr= 10 to 1
DISPLAY A:B:
A=A+B
B=A+B
NEXT ctr
END Series()
Ans: Corrected Program:
DECLARE SUB Series()
CLS
CALL Series
END
SUB Series()
REM Program to generate 1 1 2 3 5 ..... up to the 20th term
A = 1
B = 1
FOR ctr = 1 TO 20
PRINT A;
C = A + B
A = B
B = C
NEXT ctr
END SUB
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"; S$
FOR I= 1 TO 10
INPUT #1, Nm$, C1, A
IF S$<>Nm$ THEN
WRITE #2, Nm$, C1, A
END IF
NEXT I
CLOSE #1, #2
KILL "Detail.dat"
NAME "Temp.dat"AS "Detail.dat"
END
a. What is the main objective of the program given above?
Ans: The main objective of the program is to remove the record of a student with a specified name from the file Detail.dat
and save the updated records in a new file, which then replaces the original file.
b. Do you get any problem in the above program if “Kill” statement is removed?
Ans: Yes, if the “KILL” statement is removed, the original Detail.dat
file will not be deleted. This will cause a conflict when trying to rename Temp.dat
to Detail.dat
, as the original Detail.dat
still exists. The program will not be able to overwrite the original file, and the update will fail.
8. Convert/ calculate as per the instruction:[4]
Ans:
i. (11111101)2 to (?)16
First, group the binary number into sets of four digits, starting from the right: (1111)(1101)
Next, convert each group to its hexadecimal equivalent:
- (1111)2=F16​
- (1101)2=D16​
So, (11111101)2=(FD)16​.
ii. (245)10 to (?)2
Divide the number by 2 and record the remainders:
245÷2=122 remainder 1
122÷2=61 remainder 0
61÷2=30 remainder 1
30÷2=15 remainder 0
15÷2=7 remainder 1
7÷2=3 remainder 1
3÷2=1 remainder 1
1÷2=0
Reading the remainders from bottom to top, (245)10=(11110101)2
iii. (1010)2×(101)2=(?)2
First, convert both numbers to decimal:
- (1010)2=1â‹…2^3+0â‹…2^2+1â‹…2^1+0â‹…2^0=8+2=10
- (101)2​=1⋅2^2+0⋅2^1+1⋅2^0=4+1=5
Now, multiply the decimal numbers: 10×5=50
Convert 50 back to binary:
50÷2=25 remainder 0
25÷2=12 remainder 1
12÷2=6 remainder 0
6÷2=3 remainder 0
3÷2=1 remainder 1
1÷2=0 remainder 1
Reading the remainders from bottom to top, (50)10=(110010)2.
Thus, (1010)2×(101)2=(110010)2.
iv. (101110)2÷(110)2(101110)2​÷(110)2​
First, convert both numbers to decimal:
- (101110)2=1â‹…2^5+0â‹…2^4+1â‹…2^3+1â‹…2^2+1â‹…2^1+0â‹…2^0=32+8+4+2=46
- (110)2=1â‹…2^2+1â‹…2^1+0â‹…2^0=4+2=6
Now, divide the decimal numbers:
46÷6=7 remainder 4
Convert 7 and the remainder 4 back to binary:
(7)10=(111)2​
(4)10=(100)2​
Thus, (101110)2÷(110)2=(111)2 remainder (100)2.
9. a. Write a program om QBASIC that will ask the user to input length, breadth and height of a room then use SUB procedure calculate its volume and FUNCTION procedure to calculate its area of four walls.[4]
Ans: QBASIC Program to Calculate Volume and Area:
DECLARE SUB CalculateVolume (length, breadth, height)
DECLARE FUNCTION CalculateWallArea (length, breadth, height)
DIM length, breadth, height AS SINGLE
INPUT "Enter the length of the room: ", length
INPUT "Enter the breadth of the room: ", breadth
INPUT "Enter the height of the room: ", height
CALL CalculateVolume(length, breadth, height)
PRINT "The area of the four walls is: "; CalculateWallArea(length, breadth, height)
SUB CalculateVolume (length, breadth, height)
volume = length * breadth * height
PRINT "The volume of the room is: "; volume
END SUB
FUNCTION CalculateWallArea (length, breadth, height)
area = 2 * height * (length + breadth)
CalculateWallArea = area
END FUNCTION
b. A sequential data file called “Record.dat” has stored data under the field heading Roll No. , Name, Gender, English, Nepali, Math and Computer. Write a program to display all the information of those students whose marks in English is more than 40. [4]
Ans: QBASIC program to display all the information of students whose marks in English are more than 40 from the sequential data file “Record.dat”:
OPEN "Record.dat" 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 English > 40 THEN
PRINT RollNo, Name$, Gender$, English, Nepali, Math, Computer
END IF
LOOP
CLOSE #1
10. Write a program in C language that asks a number and check whether it is odd or even.[4]
Ans: Here is the C program that asks a number and checks whether it is odd or even:
#include <stdio.h>
int main() {
int number;
printf("Enter a number: ");
scanf("%d", &number);
if (number % 2 == 0) {
printf("%d is even.\n", number);
} else {
printf("%d is odd.\n", number);
}
return 0;
}
OR
Write a program in C language to display the series 1,1,2,3,5,8 up to 10thterms.
Ans: Here is the C program to display the Fibonacci series up to the 10th term:
#include <stdio.h>
int main() {
int n = 10, t1 = 0, t2 = 1, nextTerm;
printf("Fibonacci Series: ");
for (int i = 1; i <= n; ++i) {
if (i == 1) {
printf("%d, ", t1);
continue;
}
if (i == 2) {
printf("%d, ", t2);
continue;
}
nextTerm = t1 + t2;
t1 = t2;
t2 = nextTerm;
printf("%d, ", nextTerm);
}
return 0;
}