XII Computer 2nd Term 2079 Science Morning shift
Group "A" Group "A" Choose the best answer. [9×1=9] 1. The primary key does not accept ……. a) Text b) Number c) Null value d) None of the above 2. The columns in the table are called ….. a) record b) Field c) memo d) report 3. Which of the following is not a protocol? a) POP b) FTP c) TCP/IP d) NOS 4. 156.0.0.1 is an IP address of a) Class A b) Class B c) Class C d) Class D 5. In a noisy environment, the best transmission medium would be ____ a) Twisted pair b) Coaxial Cable c) Optical Fiber d) The Atmosphere 6. Argument passed in the function call is called a …… a) formal parameter b) Actual Parameter c) both a and b d) strict parameter 7. For given struct with tag student, if we write Struct student variable, variable1; it will create …. variables. a) 1 b) 2 c) 3 d) 0 8. Which of the following methods is used to access HTML elements using JavaScript? a) getElementById() b) getElementByClassName() c) Both a and b d) getElements 9. What will be the output of the following code in JavaScript? <script type="text/javascript"> var a="computer"; var b="science"; c=a+" "+b; document.write(c); </script> a) computer b) science c) computerscience d) computer science Group "B" Short answer questions. [5×5=25] 10. What is database software? Explain about any four SQL commands with examples. [1+4] OR In networking, explain about star topology and ring topology. [5] 11. Differentiate between centralized and distributed database. [5] 12. What is transmission media? Explain guided media with types (any one). [5] OR Using JS, write a program to input your name and grade using form. Display the record in div using onclick() event. [5]<form name="myForm">
Enter name :
<input type="text" name="userName">
<br><br>
Enter grade :
<input type="text" name="userGrade">
<br>
<input type="button" onclick="display()" value="click">
</form>
<div id='ans'></div>
<script type="text/javascript">
function display() {
var naam,g,c;
naam=document.myForm.userName.value;
g=document.myForm.userGrade.value;
c=naam+g;
document.getElementById('ans').innerHTML=c;
}
</script>
13. Explain any two data file handling functions used in the c program. [2.5+2.5]
14. Write C program to input eid, ename and salary for ‘n’ employees using structure. Then print them in appropriate format. [5]
#include<stdio.h>
struct employee
{
int eid;
char ename[100];
float salary;
}e[100];
int main()
{
int i,n;
printf("Enter value of n : ");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("Enter employee id, name and salary : ");
scanf("%d%s%f",&e[i].eid,e[i].ename,&e[i].salary);
}
printf("\n ------Output------\n");
for(i=0;i<n;i++)
{
printf("%d\t%s\t%f\n",e[i].eid,e[i].ename,e[i].salary);
}
return 0;
}
Group "C"
Long answer questions. [8×2=16]
15. a) Explain about two database models. [4]
b) For the following table, with necessary steps normalize it into 2NF. [4]
customer_id | store_id | purchase_location |
---|---|---|
1 | 1 | Los Angles |
1 | 3 | San Francisco |
2 | 1 | Los Angles |
3 | 2 | New York |
4 | 3 | San Francisco |
XII Computer 2nd Term 2079 Science Day Shift
Group "A" Rewrite the correct options of each question in your answer sheet. [9×1=9] 1. What do you mean by one to many relationship between Teacher and Class table? a) One class may have many teachers b) One teacher can have many classes c) Many classes may have many teachers d) Many teachers may have many classes 2. Which data type is not supported by MYSQL? a) int b) float c) char() d) allchars() 3. DHCP stands for a) Dynamic Host Configuration Protocol b) Digital Host Communication Protocol c) Digital Host Communication Provider d) Dynamic Host Configuration Provider 4. Which of the following transmission directions listed is not a legitimate channel? a) Simplex b) Half Duplex c) Full Duplex d) Double Duplex 5. Which software prevents external access to a system? a) Firewall b) Gateway c) Router c) Virus checker 6. In JS, the "function" and " var" are known as a) Keywords b) Data types c) Declaration statements d) Prototypes 7. In JS, which of the following variables takes precedence over the others if the names are the same? a) Global variable b) Local variable c) a and b of the above d) Super variable 8. What is the output of this statement “printf("%d", (X++));”? a) The value of (a + 1) b) The current value of X c) Error message d) Garbage 9. What will be the result of len variable after execution of the following statements? int len; char str[] = {"Trinity College @ Dillibazar"}; len = strlen(str1); a) 7 b) 25 c) 28 d) 14 Group "B" Give short answer to the following questions. [5×5=25] 10. What is networking? Explain about any two networking devices? [1+4] OR What is DBMS? Explain the benefits of a centralized database system. [1+4] 11. Explain about primary key and foreign key. [2.5+2.5] 12. What is protocol? Explain any three communication protocols. [2+3] OR What is JavaScript? Write a JavaScript code to check if the given string is palindrome or not. [1+4] 13. In C language, what is the significance of the use of a pointer? How would you use an array as a pointer? Give an example. [2+3] Ans: Pointers are one of the things that make C stand out from other programming languages, like Python and Java. They are important in C, because they allow us to manipulate the data in the computer's memory. This can reduce the code and improve the performance. If you are familiar with data structures like lists, trees and graphs, you should know that pointers are especially useful for implementing those. And sometimes you even have to use pointers, for example when working with files. Pointer to an array: Pointer to an array is also known as array pointer. We are using the pointer to access the components of the array. int a[3] = {3, 4, 5 }; int *ptr = a; We have a pointer ptr that focuses to the 0th component of the array. We can likewise declare a pointer that can point to whole array rather than just a single component of the array. Syntax: data type (*var name)[size of array]; Declaration of the pointer to an array: // pointer to an array of five numbers int (* ptr)[5] = NULL; The above declaration is the pointer to an array of five integers. We use parenthesis to pronounce pointer to an array. Since subscript has higher priority than indirection, it is crucial to encase the indirection operator and pointer name inside brackets. 14. WAP in ‘C’ to display factorial of any given number using a recursive function. [5] Group "C" Give long answer to the following questions. [8×2=16] 15. Define computer network architecture. Differentiate between client/server and peer to peer network. [2+6] OR What is data security and its importance? Describe different methods to protect the database of an organization. [3+5] 16. WAP to write successive records of a few students to the file called “student.txt”. And delete records of those students who didn’t score 60 percent on their annual examination. Suppose the fields are students name and percentage. [8]#include<stdio.h>
#include<conio.h>
int main()
{
char name[100];
float per;
FILE *fp;
fp=fopen("student.txt","w");
char ch='y';
while(ch!='n')
{
printf("Enter name and percentage : ");
scanf("%s%f",name,&per);
if(per>=60)
fprintf(fp,"%s\t%f\n",name,per);
printf("Add more records : ");
ch=getche();
}
return 0;
}