Group – “A” ( 10 X 1 = 10 )
1. Answer the questions in one sentence: ( 6 X 1 = 6 )
a. What is web browser?
Ans: A web browser is a software application used to access and view websites on the internet.
b. Mention any two services provided by Internet.
Ans: Email and online banking.
c. What is the maximum length of field name in MS – Access?
Ans: 64 characters.
d. Which is the logic data type of MS – Access?
Ans: Yes/No.
e. What is Modular programming?
Ans: Modular programming is a software design technique that emphasizes dividing a program into separate, self-contained modules that can be developed, tested, and maintained independently.
f. Mention any two basic data type of C language.
Ans: int and char.
2. Write a appropriate technical term for the following: ( 2 X 2 = 4 )
a. Network of networks.
Ans: Internet.
b. Computer Program that protects computer from computer virus.
Ans: Antivirus software.
3. Write the full form of the following: ( 2 X 1 = 2 )
a. FTP: File Transfer Protocol.
b. MAN: Metropolitan Area Network.
Group – “B”[ 9 X 2 = 18]
4. Answer the following questions:
a. What is network topology? List any two type of network topology.
Ans: Network topology refers to the arrangement of various elements (links, nodes, etc.) in a computer network; two types are star topology and bus topology.
b. Define Cyber law and Cyber crime.
Ans: Cyber law is the legal framework that governs activities in the digital environment, while cyber crime refers to illegal activities conducted using computers and the internet.
c. What is password. Write any importance of password protection.
Ans: A password is a string of characters used to authenticate a user to access a system or service; password protection is important to safeguard sensitive information from unauthorized access.
d. What is online payment? Write any two online payment in Nepal.
Ans: Online payment is the transfer of funds over the internet to complete a transaction; two methods in Nepal are eSewa and Khalti.
e. Define Virtual reality. Write any two areas where virtual reality is used.
Ans: Virtual reality is a simulated experience that can be similar to or completely different from the real world; it is used in gaming and medical training.
f. What is DBMS? Write four objects of MS – Access.
Ans: DBMS (Database Management System) is software for creating, managing, and manipulating databases; four objects in MS-Access are tables, queries, forms, and reports.
g. What are validation text and validation rule?
Ans: Validation rule is a criterion that data entered into a database field must meet, and validation text is the message that appears when the entered data violates the validation rule.
h. What is form. Write any two advantages of it.
Ans: A form is a database object that provides a user-friendly interface for data entry and display; two advantages are easier data input and enhanced data validation.
i. What is foreign key? Why is primary key necessary in record?
Ans: A foreign key is a field in one table that uniquely identifies a row of another table; a primary key is necessary to uniquely identify each record in a table and ensure data integrity.
5. Write the output of the given program. Show with dry run table.[2]
DECLARE SUB Series(A)
CLS
A= 20
CALL Series(A)
END
SUB Series(A)
FOR K = 1 to 5
PRINT A;
A= A+10
NEXT K
END SUB
Ans: Output of the Given Program with Dry Run Table:
Dry Run Table:
K | A (Initial) | A (After Increment) | Output |
---|---|---|---|
1 | 20 | 30 | 20 |
2 | 30 | 40 | 30 |
3 | 40 | 50 | 40 |
4 | 50 | 60 | 50 |
5 | 60 | 70 | 60 |
Output:
20 30 40 50 60
6. Re- write the given program after correcting the bug:[2]
REM Program to make a word reverse
DECLARE FUNCTION Rev$(N$)
CLS
INPUT "Enter a word": N$
DISPLAY "Reversed is": Rev$(N$)
END
FUNCTION Rev$(N$)
FOR K= LEN$(N$) to 1 STEP-1
B$=B$+MID$(N$,1,K)
NEXT K
B$=REV$
END FUNCTION
Ans: Corrected program:
REM Program to make a word reverse
DECLARE FUNCTION Rev$(N$)
CLS
INPUT "Enter a word: ", N$
PRINT "Reversed is: "; Rev$(N$)
END
FUNCTION Rev$(N$)
B$ = ""
FOR K = LEN(N$) TO 1 STEP -1
B$ = B$ + MID$(N$, K, 1)
NEXT K
Rev$ = B$
END FUNCTION
7. Study the following program and answer the given questions: ( 2 X 1 = 2 )
OPEN "EMP.DAT" FOR INPUT AS #1
DO
INPUT #1, N$, A$, S
IF UCASE$(A$)= "KATHMANDU" THEN
PRINT N$, A$, S
END IF
LOOP WHILE NOT EOF(1)
CLOSE #1
END
a. write the use of statement “INPUT #1, N$, A$, S” in the above program.
Ans: The statement INPUT #1, N$, A$, S
reads a line of data from the file EMP.DAT
and assigns the values to the variables N$
, A$
, and S
.
b. What happen if you remove “UCASE” from the above program?
Ans: If “UCASE” is removed, the program will only print records where the value of A$
is exactly “KATHMANDU” in uppercase, and it will not match entries with lowercase or mixed case letters, potentially missing some records.
8. Convert/ Calculate as per the instruction: ( 4 x 1 = 4 )
Ans:
a. (10110011)2 to (?)16
To convert binary to hexadecimal, group the binary digits into sets of four, starting from the right, and then replace each group with its hexadecimal equivalent.
Binary: 1011 0011
Hexadecimal: B3
So, (10110011)2 = (B3)16
b. (410)10 to (?)2
To convert decimal to binary, repeatedly divide the number by 2 and write down the remainders in reverse order.
4 ÷ 2 = 2 remainder 0
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1
Read the remainders from bottom to top: 100
So, (410)10 = (100)2
c. (1001 + 110)2 – (1000)2
Perform binary addition first, then subtraction.
1001
+ 110
------
1111
- 1000
--------
111
So, (1001 + 110)2 – (1000)2 = (111)2
d. (10110)2​ ÷ (101)2
Perform binary division.
1
__________
101 ) 10110
-101
__________
1010
-1010
__________
0
So, (10110)2​ ÷ (101)2​ = (1)2
9. a. Write a program to calculate Area of circle using Function procedure and use Sum procedure to calculate its calculate its circumstances in Q – Basic.[4]
Ans: QBASIC Program to Calculate Area and Circumference of a Circle:
DECLARE FUNCTION CalculateArea(radius)
DECLARE SUB CalculateCircumference(radius)
CLS
' Function to calculate area of circle
FUNCTION CalculateArea(radius)
CalculateArea = 3.14159 * radius * radius
END FUNCTION
' Sub procedure to calculate circumference of circle
SUB CalculateCircumference(radius)
circumference = 2 * 3.14159 * radius
PRINT "The circumference of the circle is: "; circumference
END SUB
INPUT "Enter the radius of the circle: ", radius
PRINT "The area of the circle is: "; CalculateArea(radius)
CALL CalculateCircumference(radius)
END
b. Write a program to create a sequential data file named “Employee.dat” to store Name, Post, Address and Salary for the numbers of employees. The program should terminate on user`s choice.
Ans: QBASIC Program to Create a Sequential Data File for Employee Records:
OPEN "Employee.dat" FOR OUTPUT AS #1
DO
CLS
INPUT "Enter employee name: ", Name
INPUT "Enter employee post: ", Post
INPUT "Enter employee address: ", Address
INPUT "Enter employee salary: ", Salary
' Write data to file
PRINT #1, Name; ", "; Post; ", "; Address; ", "; Salary
' Ask user if they want to continue entering records
INPUT "Do you want to enter another employee record? (Y/N): ", choice$
IF UCASE$(choice$) <> "Y" THEN EXIT DO
LOOP
CLOSE #1
END
10. Write a program in C language to input a number and then check whether the number is positive, negative or zero number.
Ans: C Program to Check Whether a Number is Positive, Negative, or Zero:
#include <stdio.h>
int main() {
int number;
printf("Enter a number: ");
scanf("%d", &number);
if (number > 0) {
printf("%d is a positive number.\n", number);
} else if (number < 0) {
printf("%d is a negative number.\n", number);
} else {
printf("The number is zero.\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: C Program to Display the Series with Their Sum:
#include <stdio.h>
int main() {
int i, sum = 0;
printf("Series: ");
for (i = 1; i <= 10; i++) {
printf("%d ", i);
sum += i;
}
printf("\nSum of series: %d\n", sum);
return 0;
}