(XII) 2nd Term 2079 Management Morning Shift
Group "A" Choose the best answer. [9×1=9] 1. In hierarchical database model, the records are arranged in …. structure. a) Tree b) Graph c) Table d) Object Oriented 2. While altering table with a new column, we have to use …. command. a) Alter and add b) change and add c) plus and add d) drop and add 3. Which of the following is the fastest media for data transmission? a) Fiber optical b) Radio wave c) Satellite d) Coaxial Cable 4. The default value of subnet address for IP 123.12.45.66 is a) 255.0.0.0 b) 255.255.0.0 c) 255.255.255.0 d) 255.255.255.255 5. The total layers in OSI is a) 1 b) 2 c) 3 d) 7 6. In JS, what would be the output? <script> var string1=”40”; var intvalue=50; alert(string1+intvalue); </script> a) 40 b) 50 c) 4050 d) 0 7. For a code in JS as given here, var a; console.log(a); it will print a) 0 b) 1 c) error d) undefined 8. Which shares the memory? a) Structure b) union c) types d) files 9. To update our data in a file, we have to use rename() and remove() functions. The remove function syntax is a) REMOVE(filename) b) remove(“filename”); c) kill(“file”); d) delete(“filename); Group "B" Short answer questions. [5×5=25] 10. Explain about switch and modem. [2.5+2.5] OR What is a function in JavaScript? Write JavaScript program using a function to find sum of ten natural numbers. [1+4]<form name="myForm">
lgt;input type="submit" onclick="sum()">
</form>
<script type="text/javascript">
function sum() {
var s=0,i;
for(i=1;i<=10;i++)
{
s=s+i;
}
document.write(s);
}
</script>
11. What is DBMS? Explain about security measures applied to data stored in database. [1+4]
12. Differentiate between centralized and distributed database. [5]
OR
Explain in brief, about basic elements used, while transmitting data in networking. [5]
13. What is FILE pointer? Explain its role in data file handling with example. [1+4]
14. Write C program using a pointer to find sum of two numbers. [5]
#include<stdio.h>
int main()
{
int a,b,s=0,*x,*y;
printf("Enter any number : ");
scanf("%d%d",&a,&b);
x=&a;
y=&b;
s=(*x)+(*y);
printf(" Sum = %d",s);
return 0;
}
Group "C" Long answer questions. [8×2=16]
15. List out the types of networking on the basis of geographical location and explain about them. [2+6]
OR
Write any two types of language supported by SQL. Then explain any three commands associated with them. Give supporting examples. [2+3+3]
16. Write a program using C language to input any ten customer’s name, address and phone number using structure. Then store them in a file ‘customer.txt’. Then read all those records and print them on screen. [8]
#include<stdio.h>
struct customer
{
char name[100],address[100];
char phone[20];
}c[10];
int main()
{
FILE *fp;
int i;
fp=fopen("customer.txt","w");
for(i=0;i<10;i++)
{
printf("Enter name, address and phone no : ");
scanf("%s%s%s",c[i].name,c[i].address,c[i].phone);
fprintf(fp,"%s\t%s\t%s\n",c[i].name,c[i].address,c[i].phone);
}
fclose(fp);
fp=fopen("customer.txt","r");
while(fscanf(fp,"%s%s%s",c[i].name,c[i].address,c[i].phone)!=EOF)
{
printf("%s\t %s\t %s\n",c[i].name,c[i].address,c[i].phone);
}
fclose(fp);
return 0;
}
(XII) 2nd Term 2079 Management Day Shift
Group "A" Rewrite the correct options of each question in your answer sheet. [9×1=9] 1. To delete an object in MYSQL, we use (a) delete (b) kill (c) erase (d) drop 2. A table named product(pid,pname,price) contains 5 records. To fetch all records we use (a) select * from product; (b) display all; (c) print all from product; (d) print * from product; 3. Which of the following is the most complex topology? (a) Bus (b) star (c) mesh (d) tree 4. The default value of subnet address for IP 135.12.45.66 is (a) 255.0.0.0 (b) 255.255.0.0 (c) 255.255.255.0 (d) 255.255.255.255 5. Which is not a transmission media? (a) Modem (b) Telephone (c) Coaxial Cable (d) Twisted Pair 6. In JS, if we use following code <script> var a=[1,2,3,4,5]; console.log(a[2]); </script> It will print (a) 3 (b) 1 (c) 2 (d) 5 7. For a code as given here, var a; a=prompt(“enter a number”); //let a=45 a++; console.log(a); will print (a) 46 (b) 1 (c) 45 (d) 54 8. In which we can access all the members at the same time. (a) structure (b) union (c) types (d) files 9. To rename data file ,we use (a) rename(“old file name”,”new file name”); (b) change name(“file name”); (c) name_change(“file”,”file”); (d) file_name(“old file name”,” new file name”); Group "B" Give short answer to the following questions. [5×5=25] 10. What is a topology? Explain its two types. [2.5+2.5] OR What is a function in JavaScript. Write a program in JS, using a function, to print multiplication table of a number. [1+4]<form name="myForm">
Enter a number :
<input type="text" name="num">
<input type="submit" onclick="multi()">
</form>
<script type="text/javascript">
function multi() {
var n,i;
n=document.myForm.num.value;
for(i=1;i<=10;i++)
{
document.write(n*i);
document.write("<br>");
}
}
</script>
11. What is DBMS? Explain about security measures applied to data stored in the database. [1+4]
12. Explain some roles of DBA. [5]
OR
Explain in brief, about any two types of transmission impairments. [2.5+2.5]
13. Differentiate between structure and union. [5]
14. Write a program in C using a pointer to find the product of two numbers. [5]
#include<stdio.h>
int main()
{
int a,b,p=1,*x,*y;
printf("Enter any number : ");
scanf("%d%d",&a,&b);
x=&a;
y=&b;
p=(*x)*(*y);
printf("Product = %d",p);
return 0;
}
Group "C"
Give long answer to the following questions. [8×2=16]
15. Classify the types of networking channel/medium. Explain any two. [2+6]
OR
Write in brief about SQL. Explain any three commands associated with DDL and DML. Give supporting examples. [2+3+3]
16. Write a program using C language to input any ten employee’s name, address and salary using structure. Then store them in a file ‘employee.txt’. Then read all records of employees who have salary <20000 and print on screen. [8]
#include<stdio.h>
struct employee
{
char name[100],address[100];
int salary;
}e[10];
int main()
{
FILE *fp;
int i;
fp=fopen("employee.txt","w");
for(i=0;i<10;i++)
{
printf("Enter name, address and salary : ");
scanf("%s%s%d",e[i].name,e[i].address,&e[i].salary);
fprintf(fp,"%s\t%s\t%d\n",e[i].name,e[i].address,e[i].salary);
}
fclose(fp);
fp=fopen("employee.txt","r");
while(fscanf(fp,"%s%s%d",e[i].name,e[i].address,&e[i].salary)!=EOF)
{
if(e[i].salary<20000)
printf("%s\t %s\t %d\n",e[i].name,e[i].address,e[i].salary);
}
fclose(fp);
return 0;
}
The End