Sei sulla pagina 1di 3

LIST OF PRACTICALS OF CLASS XII (Computer Science)

S.No Practical Sign


Write a program to sum first N terms of the following Series
1
2 3 4
1 + X/2! – X /4! + X /6! - X /8! + ………………………

Write a program to input two numbers m and n and display first m


2
multiples of n.

Write a program using user defined function Swap() which receives two
3 integers as parameters and swaps the values.(Demonstrating call by
reference

Write a program using function to check whether a given string is


4
palindrome or not.

Write a program to input 10 elements in an integer array and then


5
display these elements in reverse order.

Write a program to read a string and print out the following :


No. of capital alphabets
6
No. of small alphabets
No. of non-alphabets

Write a menu based program to do the following on double dimensional


array (Square Matrix)on the basis of user’s choice. Write function for
all the operations.
7 1. To Sum elements of each diagonal display it on screen
2. To Display only Middle Row and Middle Column
3. To Display only Lower Half part of matrix
4. Exit

Write a menu based program to do the following on double dimensional


array (M X N Matrix) on the basis of user’s choice. Write function for
all the operations.
8 1. To Sum elements of each Row display it on screen
2. To Sum elements of each Column display it on screen
3. To Sum only those elements which are divisible by either 3 to 5
4. Exit

Write a program to search a number from an array of N numbers using


9
the Linear Search
Write a program to search a number from an array of N numbers using
10 the Binary Search

Write a program to make a structure of student with the following


details- Name,Age,Class, marks in 5 subjects. Get Input from the user
11
for the data Name, Age, Class Marks and Find the average & result of
the student if average>=40 result ‘P’ if not result ‘F’
Define a class student with the following specifications:
Private members of the class:
Admission Number - An Integer
Name - string of 20 characters
Class - Integer
12 Roll Number - Integer
Public members of the class:
getdata() - To input the data
showdata() - To display the data
Write a program to define an array of 5 objects of this class, input the
data in this array and then display this list.

Write the function WriteStory() that will take a story from keyboard and
write to the file “STORY.TXT”. Write another function CopyStory() to
13 copy only those words that are not starting with uppercase and vowels
from “STORY.TXT” and write to another text file “STORY1.TXT”. Call
the above two function in main() function.

Write a menu driven program in C++ to perform the following functions


on a binary file “BOOK.DAT” containing objects of the following class:
class Book
{ int BookNo;
char Book_name[20];
public:
void enterdetails(); // function to enter book details
void showdetails() ; //function to display Book details
14 int Rbook_no() { return Book_no;} //function to return Book_no
int Rbook_name() {return Book_name;} //function to return name
};
1. Append Records
2. Modify a record for a given book no.
3. Delete a record with a given book no.
4. Search for a record with a given Book name
5. Search for a record with a given Book number
6. Exit

Write a menu based program using array to arrange the numbers using
the following methods on the basis of user’s choice.
1. Ascending Order Using Selection Sort
15
2. Descending Order using Bubble Sort
3. Ascending Order Using Insertion sort
4. Exit
Write a menu based program using Linked Implementation to do Stack
operations with the following options on the basis of user’s choice.
1. Push an Element
2. Pop an Element
3. Print Stack
4. Exit
struct Node
16 { int X, Y; Node *Link; };
class STACK
{ Node * Top;
public:
STACK( ) { TOP=NULL;}
void PUSH( ); void Pop( ); ~STACK( );
};
Write a menu based program using array to do Stack operations with the
following options on the basis of user’s choice.
1. Push an Element
2. Pop an Element
3. Print Stack
4. Exit.
class stack
17 { int data[10];
int top;
public:
Stack( ) { top=-1;}
void push ( ); // to push an element into the stack
void pop ( ) ; // to pop an element into the stack
void display( );// to display all the elements from the stack
};
Write a menu based program using array to do Queue operations with
the
following options on the basis of user’s choice.
1. Insert an Element
2. Delete an Element
3. Print Queue
18 4. Exit
class Q
{ int data[10];
int front, rear;
public:
Q ( ) { front=rear=-1;}
void Insert ( ); void Del ( ) ; void Display( );
Write a menu based program using Linked List to do Queue operations
with the following options on the basis of user’s choice.
1. Insert an Element
2. Delete an Element
3. Print Queue
4. Exit
struct NODE
{ long TicketNo;
19 char PName[20]; // Passenger Name
NODE *NEXT;
}
class TrainQueue
{ NODE *rear, *front;
public:
TrainQueue( ) { rear = NULL, front = NULL ;}
void Q_Insert( ); void Q_Delete ( );
void Q_Display ( ); ~TrainQueue( );
};
Write a menu based program using array to do Circular Queue
operations with the following options on the basis of user’s choice.
1. Insert an Element
2. Delete an Element
3. Print Queue
20 4. Exit
class Q
{ int data[10]; int front, rear;
public:
Q ( ) { front=rear=-1;}
void Insert ( ); void Del ( ) ; void Display( );
};

Potrebbero piacerti anche