Vous êtes sur la page 1sur 3

COMPUTER SCIENCE JOURNAL PROGRAMS CLASS XII

Q.1 Write a C++ program to make a class Outfit in C++ with the following descriptions: Private Members: OCode, Otype,OFabric of type String, Osize of type Integer, OPrice of type Float A function InitPrice() which calculates and assigns the value of OPrice as follows: When OFabric is Denim When OFabric is not Denim OType OPrice OType OPrice Trouser 1500 Trouser Price reduced by 25% Jacket 2500 Jacket Price reduced by 25% Public Members: A constructor to assign initial values of OCode, OType and OFabric with the word Not Initialised and OPrice and OSize with 0. A function Input() to input the values of the data members OCode, OType, OSize and OFabric and invoke InitPrice() function. A function Display() which displays the content of all the data members for an Outfit. Q.2 Create student management system using inheritance. Classes Student, Primary, Secondary, SrSec to be used and generate a report card. Make functions for accepting the student details, marks and calculate grades accordingly. Final entries to be stored in a file named StuDetails.dat of records. Only new records will be added and data should not be lost. Q.3 Create a class Library that stores all the information regarding books. Also create a class Members that will store the member information along with the date of issue and date of return. If the no. of days exceeds 14 days then a fine of Re.1 to be charged. Q.4 Create a class Stock which has information like item no, item name, unit price, no. present, minimum number and functions for updating, adding and deleting the records. The data should be stored in a file named Stocks.dat. As soon as an item is issued the no. of item should be updated and if the no. is less than the minimum number then an appropriate message should be displayed. Q.5 Write a C++ program that reads contents from a text file PARA.txt and performs the following operations according to the users choice. i) Display the contents of the file ii) Count the number of uppercase, lowercase characters and no. of blank spaces. iii) Accept a word from the user and count the no. of its occurrences in the file as independent word. Q.6 Given a binary file Telephone.dat, containing records of the following class Directory: class Directory { char Name[20]; char Address[30]; char AreaCode[5]; char PhoneNo[15]; public: void Register(); void Show(); int checkCode(char AC[]) { return strcmp(AreaCode, AC); } }; Write functions for the following: i) To copy all the records from Telephone.dat to phone.dat where areacode=23 ii) To delete a particular record based on phone number. iii) To add a record. ( The Data is sorted in ascending order of name.) iv) To modify a particular record. Search by Areacode and phone number.

Q.7 Write a program to enter data in a dynamic array. The program should keep reading the numbers and inserting in the array. Stop when the user enters -1. Q.8 Write a C++ program to perform the following operations using user defined functions and pointers. i) String Comparison ii) String Copy iii) String concatenation iv) String Reversal (Do not use library functions) Q.9 Write a program to accept the quarterly sales for the entire year of 5 salesmnan. Make a function to display the details of the salesman who has made the maximum total sales using pointers. Define appropriate functions for: i) calculating total sales ii) finding max_sales iii) printing details of salesman Q.10 Suppose 5 names are stored in an array of pointers names[] as below: char *names[]={Anand, Naureen, Banjot, Wahid, Sheena}; Write a program to reverse the order of these names. Q.11 Write a C++ program to perform Linear Search in an array of structure that contains information about students : rollno, name and marks. Q.12 Write a C++ program to perform Binary Search in an array of structure that contains information about students : rollno, name and marks. Q.13 Write a C++ program to perform Selection Sort in an array that contains marks of 50 students. Q.14. Write a C++ program to perform Bubble Sort in an array that contains price of 50 products. Q.15 Write a C++ program to perform Insertion Sort in an array. Q.16 Write a C++ program to perform Merging of two arrays A and B into a third array C. Q.17 Write a C++ program to depict the insertion and deletion in linked list. Q.18 Write a C++ program to show static implementation of Stack. Q.19 Write a C++ program to show the dynamic implementation of Stack that contains student information like roll no, name, std and percentage. Q.20 Write a C++ program to show the static implementation of Linear Queue that contains employees information like empno, empname, desination and salary. Q.21 Write a C++ program to show the dynamic implementation of Linear Queue that contains employees information like empno,empname, desination and salary. Q.22 Write a C++ program to show insertion and deletion in Circular Queue. Q.23 Create Table Salesman - SalesmanID, Name, Company, Designation Create table Sales - TransID, date of sale, Product name, Type, Amount, salesman ID Write queries toi) To display the details of those Salesmen whose Designation is Executive. ii) To display the details of Sales made on or before 31st march, 2011. iii) To display the name of Salesman who has made the maximum sales. iv) To increase the Amount by 10%. v) To show the distinct number of Items that were sold.

Q.24 Create Table Flights- Fl_No, Starting, Ending, No_Flights, No_Stops, No.ofdays Available ( per week) Create table Fares- Fl_No, Airlines, Fare, Tax % Write Queries toi) Display Fl_No , Airlines and fare for the flights from Mumbai to Delhi which are available twice a week. ii) Arrange the Contents of the table Flights in the Ascending order of FL_NO. iii) Display the FL_NO for all the flights from either Delhi or Kanpur to Mumbai iv) To update the fare of Indian Airlines by 20%. v) Display the details of Flight with minimum number of stops. Q.25 Create Table Furniture-No., Itemname, Type, dateofStock, Price, Discount Create Table Arrivals- No., Itemname, Type , dateofStock, Price, Discount Write queriesi) To show all information about the baby cots from the Furniture table. ii) To list the Itemname which are priced at more than 15000 from the Furniture table. iii) To list Itemname and Type of those items, in which dateofStock is before 22/01/02 from the Furniture table in descending order of Itemname. iv) To display Itemname and dateofStock of those items in which the discount percentage is more than 25 from furniture table v) To count the number of items, whose type is Sofa from Furniture table.

Vous aimerez peut-être aussi