Trinity International SS & College
Second Term Examination 2078
Grade – XII Management – Morning Shift
Computer Science
Candidates are requested to give their answers in their own words as far as practicable. The figures in the margin indicate full marks.
Time: 2 hrs. Full Marks: 50
Group ‘A’
(Multiple Choice Questions)
Tick the best alternative. (9x1=9)
Q1. A term ____ is used to refer to a row.
(a) Attribute (b) Tuple (c) Field (d) Instance
Q2. Which SQL keyword is used to retrieves a maximum value?
(a) MOST (b) TOP (c) MAX (d) UPPER
Q3. Cabling structure of a network is called _______
(a) Topology (b) Arrangements (c) Physical Structure (d) None
Q4. Example of full duplex mode is ______
(a) Newspaper (b) Radio (c) Walkie-Talkie (d) Telephone / Mobile
Q5. Which of the following is an example of LAN?
(a) Network within a building (b) Network within a city
(c) Network within country (d) All of above
Q6. An example of client-side scripting language is ...
(a) PHP (b) JSP (c) ASP (d) JavaScript
Q7. Which of the following statement is not a type of looping statement?
(a) do while (b) for (c) switch case (d) while
Q8. What is meant by 'a' in the following C operation?
fp=fopen('random.txt","w");
(a) write (b) what (c) create (d) None of above
Q9. To store multiple variables of similar data types , we use ____
(a) String (b) Array (c) Float (d) None
Group ‘B’
Give short answer to the following questions. (5x5=25)
Q10. Explain simplex and full duplex with their examples. (2.5+2.5)
OR
What is an operator in JavaScript. Write a program using JavaScript to display first ten natural numbers. (1+4)
Q11. What is normalization? Explain 1 NF with an example. (1+4)
Q12. Differentiate between centralized and distributed database. (5)
OR
Define the term “networking”. Explain its advantages. (1+4)
Q13. What is user defined function? Explain its any two components. (1+2+2)
Q14. Write a program in C using pointer to find factorial value of given number. (5)
Group ‘C’
Give long answer to the following question. (2x8=16)
Q15. What is communication system? Draw its block diagram and explain its elements.(1+2+5)
OR
(a) Make a table named “Registration” in MySQL and insert following records. (2+2)
Regd_No | S_Name | S_Gender | S_Class |
---|---|---|---|
2707001 | Abhi Basnet | Male | M1 |
2707002 | Annie Shrestha | Female | M1 |
Ans : create database abc123;
use abc123;
create table registration
(
regd_no int primary key,
s_name varchar(30),
s_gender varchar(10),
s_class varchar(5)
);
insert into registration (regd_no,s_name,s_gender,s_class)
values (2707001,'Abhi Basnet','Male','M1');
insert into registration (regd_no,s_name,s_gender,s_class)
values (2707002,'Annie Shrestha','Female','M1');
to update:
update registration set s_class='M2';
to delete:
delete from registration where regd_no='2707001';
(b) Write SQL code to update all class to “M2” in above table. (2)
(d) Write SQL code to delete a record having registration number ‘2707001’. (2)
Q16. Write a program in C to create a data file “staff.txt” which stores Employee’s Name, Address and Post until user press yes. After that display all the records of file “staff.txt”. (4+4)
#include<stdio.h>
#include<conio.h>
int main()
{
char name[100],address[100],post[50];
FILE *fp;
fp=fopen("staff.txt","w");
char ch='y';
while(ch!='n')
{
printf("\n Enter name , address and post: ");
scanf("%s%s%s",name,address,post);
fprintf(fp,"%s\t %s\t %s\n",name,address,post);
printf("Add more records (y-yes/n-no)");
ch=getche();
}
fclose(fp);
fp=fopen("staff.txt","r");
printf("\n Name\t Address\t Post\n");
while(fscanf(fp,"%s%s%s",name,address,post)!=EOF)
{
printf("%s\t %s\t %s\n",name,address,post);
}
fclose(fp);
}
The End