0% found this document useful (0 votes)
28 views3 pages

Xavier Prelim

This document is the preliminary exam paper for Computer Science for STD-XII at St. Xavier’s Higher Secondary School, Mapusa Goa, for the academic year 2022-23. It consists of three sections with a total of 18 questions covering various topics in computer science, including data structures, file handling, and C++ programming. The exam is scheduled for March 3, 2023, and has specific instructions regarding question types and programming requirements.

Uploaded by

advayborkar38
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views3 pages

Xavier Prelim

This document is the preliminary exam paper for Computer Science for STD-XII at St. Xavier’s Higher Secondary School, Mapusa Goa, for the academic year 2022-23. It consists of three sections with a total of 18 questions covering various topics in computer science, including data structures, file handling, and C++ programming. The exam is scheduled for March 3, 2023, and has specific instructions regarding question types and programming requirements.

Uploaded by

advayborkar38
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

ST. XAVIER’S HIGHER SECONDARY SCHOOL, MAPUSA GOA.

ACADEMIC YEAR 2022-23


SECOND TERM PRELIMINARY EXAM
STD -XII SCIENCE
SUBJECT: COMPUTER SCIENCE (H-4705)
DATE: 03/03/2023 ROLL NO.:________
TIME: 2:30 – 4:00 P.M TOTAL MARKS: 30
Instructions:
(i) All questions are compulsory.
(ii) Programs should be written in C++ only.
(iii) State your assumptions clearly.
(iv) The question paper consists of three Sections A,B and C.
Section A: Consists of 9 questions of 1 mark each.
Section B: Consists of 6 questions of 2 mark each.
Section C: Consists of 3 questions of 3 mark each.
(v) Total Number of questions is 18.
(vi) There is no overall choice, however there is an internal choice for
question number 17 and 18.
(vii) Figures to the right indicate full mark.

SECTION-A

Q1. Expand the abbreviation TCP/IP. (1)


Q2. Which data switching technique is used in the internet? (1)
Q3. Why are the cables twisted in Twisted pair cable? (1)
Q4. Define a Singly Linked List. (1)
Q5. What are Pointers? (1)
Q6. Define Queue. (1)
Q7. Name the most appropriate class which has member function seekg(). (1)
Q8. What does “cin” and what does it represent? (1)
Q9. State any four differences between circuit switching and packet switching. (1)

SECTION-B

Q10.Write a user defined function named “lower()” which accepts a double


dimensional array and its size as parameters and returns the sum of lower
triangular elements. (Note: No. of Rows = NO. of Columns) (2)

EXAMPLE: For a matrix 5x5


1 2 3 4 5
2 4 6 8 0
1 3 5 7 9
8 6 4 2 0
9 7 5 3 1
The function returns: 48
Q11. Write a user defined function named “difference()” which accepts 2, 1-D arrays (A
&B) and its size (M&N) as parameters. It determines and displays all elements of
A that are not in B. (2)
EXAMPLE:

A(M=6) 1 20 13 4 5 6

B(N=4) 1 4 8 7
The Output shown is: 20,13,5,6

Q12. Consider the following: (2)


class queue
{ struct node
{
char name[50];
struct node *link;
}*front,*rear;
public: queue()
{ front=rear=NULL;}
void append();
void deletion();
void display();
};
Define the member function append() to add node to the queue.

Q13. Consider a text file named sample.txt, in which every single line contains roll name
and phone number (7 digit), separated by space. Write a complete procedural C++
program to read a text file named “sample.txt” and display all the information of
students whose phone number starts with 22. (2)

Q14. Consider a text file named “story.txt”. Write a complete procedural C++ program
to determine the total number of consonants in the file “sample.txt” for display. (2)

Q15. Consider the following: (2)


#include<iostream.h>
#include<____1?_____>
using namespace std;
class student
{ int roll;
char name[30];
float percent;
public: void getdata();
void putdata();
};
int main()
{ int s;
?2
?3
s=?4
cout<<”\nFile size: “<<s<<” bytes”;
return 0;
}
Write the missing statements 1? , 2?, 3? and ?4 in order to calculate size of binary
file sample.dat which contains object of class student.
SECTION-C

Q16. In process of converting infix expression to postfix using stack, write the steps
carried out when a right parenthesis is encountered. (3)

Q17. Consider the following: (3)

Assume that file named “sample.dat” contains objects of class student.

#include<iostream.h>
#include<fstream.h>
using namespace std;
class student
{
int roll;
char name[30];
float percent;
public: void getdata();
void putdata();
};

Define main() function such that it performs deletion of an object from a specific
position in “sample.dat”.
OR
Define main() function such that it creates a new file named “pass.dat” which
consists of all students who have secured percent>=75 from file “sample.dat”.

Q18. Consider the following: (3)


#include<iostream.h>
struct element
{
int data;
struct element *next;
};
typedef struct element node;

class list
{

node *start;
public: list(){start=NULL;}
void creation();
void insertion();
void display();
};

Define member function “creation()” to create a singly linked list of “n” nodes.
OR
Define member function “insertion()” to insert a new node at a position given by
user in a singly linked list.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

You might also like