Time: 3 HOURS Maximum Marks: 100

Similar documents
List of Practical for Class XII Computer Science

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK

PROGRAMMING IN C++ (Regulation 2008) Answer ALL questions PART A (10 2 = 20 Marks) PART B (5 16 = 80 Marks) function? (8)

RAJA COLLEGE OF ENGINEERING & TECHNOLOGY

R13. II B. Tech I Semester Supplementary Examinations, May/June DATA STRUCTURES (Com. to ECE, CSE, EIE, IT, ECC)

Table of Contents. Chapter 1: Introduction to Data Structures... 1

VALLIAMMAI ENGINEERING COLLEGE

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

End-Term Examination Second Semester [MCA] MAY-JUNE 2006

PROGRAMMING IN C AND C++:

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

Question Paper Code : 97044

Course goals. exposure to another language. knowledge of specific data structures. impact of DS design & implementation on program performance

Course Name: B.Tech. 3 th Sem. No of hours allotted to complete the syllabi: 44 Hours No of hours allotted per week: 3 Hours. Planned.

Data Structures in C++ Using the Standard Template Library

Computer Programming C++ (wg) CCOs

BRONX COMMUNITY COLLEGE of the City University of New York DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE. Sample Final Exam

WITH C+ + William Ford University of the Pacific. William Topp University of the Pacific. Prentice Hall, Englewood Cliffs, New Jersey 07632

Name CPTR246 Spring '17 (100 total points) Exam 3

Syllabus for Bachelor of Technology. Computer Engineering. Subject Code: 01CE0301. Subject Name: Data Structure. B.Tech. Year - II


Babaria Institute of Technology Computer Science and Engineering Department Practical List of Object Oriented Programming with C

Mathematics Shape and Space: Polygon Angles

COSC 2007 Data Structures II Final Exam. Part 1: multiple choice (1 mark each, total 30 marks, circle the correct answer)

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May

DYNAMIC MEMORY ALLOCATION AND DEALLOCATION

KRISHNA KANTA HANDIQUI STATE OPEN UNIVERSITY Hiranya Kumar Bhuyan School of Science and Technology

First Semester - Question Bank Department of Computer Science Advanced Data Structures and Algorithms...

ENGINEERING PROBLEM SOLVING WITH C++

Test 1 Last 4 Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. 2 points each t 1

SHSAT Review Class Week 3-10/21/2016

University of Illinois at Urbana-Champaign Department of Computer Science. Final Examination

Course Review for Finals. Cpt S 223 Fall 2008

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

KRISHNA KANTA HANDIQUI STATE OPEN UNIVERSITY Hiranya Chandra Bhuyan School of Science and Technology

n 2 ( ) ( ) Ο f ( n) ( ) Ω B. n logn Ο

INDIAN SCHOOL SOHAR FIRST TERM EXAM ( ) INFORMATICS PRACTICES

DEPARTMENT OF COMPUTER APPLICATIONS B.C.A. - FIRST YEAR ( REGULATION) SECOND SEMESTER LESSON PLAN SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

END TERM EXAMINATION

TIME: 3 HOURS MARKS: a. Develop a java program to sort an array of N numbers in ascending order. (40)

CSE 212 : JAVA PROGRAMMING LAB. IV Sem BE (CS&E) (2013) DEPT OF COMPUTER SCIENCE & ENGG. M. I. T., MANIPAL. Prepared By : Approved by :

LESSON PLAN B.C.A. - FIRST YEAR ( REGULATION) SECOND SEMESTER

Prelim 2 Solution. CS 2110, November 19, 2015, 7:30 PM Total. Sorting Invariants Max Score Grader

( ) D. Θ ( ) ( ) Ο f ( n) ( ) Ω. C. T n C. Θ. B. n logn Ο

FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- MARCH, 2012 DATA STRUCTURE (Common to CT and IF) [Time: 3 hours

E.G.S. PILLAY ENGINEERING COLLEGE (An Autonomous Institution, Affiliated to Anna University, Chennai) Nagore Post, Nagapattinam , Tamilnadu.

Prelim 2 Solution. CS 2110, November 19, 2015, 5:30 PM Total. Sorting Invariants Max Score Grader

CMSC132, Practice Questions

n 2 ( ) ( ) + n is in Θ n logn

Course Review for. Cpt S 223 Fall Cpt S 223. School of EECS, WSU

DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305

( ) 1 B. 1. Suppose f x

M.C.A DEGREE EXAMINATION,NOVEMBER/DECEMBER 2010 Second Semester MC 9222-OBJECT ORIENTED PROGRAMMING (Regulation 2009)

( ) ( ) C. " 1 n. ( ) $ f n. ( ) B. " log( n! ) ( ) and that you already know ( ) ( ) " % g( n) ( ) " #&

12 Abstract Data Types

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

D. Θ nlogn ( ) D. Ο. ). Which of the following is not necessarily true? . Which of the following cannot be shown as an improvement? D.

logn D. Θ C. Θ n 2 ( ) ( ) f n B. nlogn Ο n2 n 2 D. Ο & % ( C. Θ # ( D. Θ n ( ) Ω f ( n)

KRISHNA KANTA HANDIQUI STATE OPEN UNIVERSITY Hiranya Chandra Bhuyan School of Science and Technology

Object Oriented Programming Using C ++ Page No. : 1. ASSIGNMENT SHEET WITHOUT USING OBJECT AND CLASSES

Computer Science 302 Fall 2009 (Practice) Second Examination, October 15, 2009

CSE 373 Spring Midterm. Friday April 21st

Prelim 2. CS 2110, November 19, 2015, 7:30 PM Total. Sorting Invariants Max Score Grader

Chapter 20: Binary Trees

DATA STRUCTURES THROUGH C++

MIDTERM EXAMINATION Spring 2010 CS301- Data Structures

Priority Queues. 04/10/03 Lecture 22 1

APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY THIRD SEMESTER B.TECH DEGREE EXAMINATION, JULY 2017 CS205: DATA STRUCTURES (CS, IT)

SAURASHTRA UNIVERSITY

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

l Determine if a number is odd or even l Determine if a number/character is in a range - 1 to 10 (inclusive) - between a and z (inclusive)

1 P a g e A r y a n C o l l e g e \ B S c _ I T \ C \

PRACTICAL LIST FOR EVEN SEMESTERS (PGDCA/MCA/MSC (CS))

Sai Nath University. Assignment For MCA 2nd Sem.

Cpt S 122 Data Structures. Course Review Midterm Exam # 1

( ) + n. ( ) = n "1) + n. ( ) = T n 2. ( ) = 2T n 2. ( ) = T( n 2 ) +1

& ( D. " mnp ' ( ) n 3. n 2. ( ) C. " n

PREREQUISITE:Individualized Educational Plan with this component. REQUIRED MATERIALS: notebook, pencil, calculator, agenda book

CITY UNIVERSITY OF NEW YORK. Creating a New Project in IRBNet. i. After logging in, click Create New Project on left side of the page.

Data Structure Advanced

n 2 C. Θ n ( ) Ο f ( n) B. n 2 Ω( n logn)

Programming II (CS300)

Algorithm Class. C C++ DS JAVA DATA STRUCTURES TRAINING INSTITUTE KPHB HYDERABAD. Mobile:

VALLIAMMAI ENGINEERING COLLEGE

CLASSIC DATA STRUCTURES IN JAVA

( ). Which of ( ) ( ) " #& ( ) " # g( n) ( ) " # f ( n) Test 1

Data Structures Brett Bernstein

Laboratory Manual. B. Sc. (Hons.) Computer Applications III Semester. Laboratory Course III: CCB 3P1

VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur

FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- OCTOBER, 2012 DATA STRUCTURE

CS210 (161) with Dr. Basit Qureshi Final Exam Weight 40%

Algorithms and programs, basic idea of pseudo-code.algorithm efficiency and analysis, time and space analysis of algorithms order notations.

DHANALAKSHMI COLLEGE OF ENGINEERING Tambaram, Chennai DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

CSE 373 APRIL 17 TH TREE BALANCE AND AVL

) $ f ( n) " %( g( n)

York University AK/ITEC INTRODUCTION TO DATA STRUCTURES. Final Sample II. Examiner: S. Chen Duration: Three hours

S.E. Sem. III [INFT] Data Structures & Analysis. Primitive Linear Non Linear

Total Score /1 /20 /41 /15 /23 Grader

( ) n 3. n 2 ( ) D. Ο

Analysis of Algorithms

Transcription:

ANNA UNIVERSITY:CHENNAI 600 025 M.E/M.Tech. DEGREE EXAMINATIONS, NOV./DEC. 2014 Regulations 2013 Third Semester B.E. Computer Science and Engineering CS6311: PROGRAMMING AND DATA STRUCTURES LABORATORY II Time: 3 HOURS Maximum Marks: 100 (I)1. Create a class Student with regno, name, CS1201, CS1202, CS1203 as data members. Include a member function to find the total and publish the result. Get minimum of five students' details and display the result in the form of list. Extend the Student into two different categories such as B.E and MCA Category B.E degree students have dept_name (CSE, ECE, EEE), dept_head, dept_location, core_subjects which is an array, subject_marks is an array containing the marks of the core subjects out of 100. Category MCA degree students have dept_name, dept_head, dept_location, core_subjects which is an array (whose size can be determined at the run time), subject_marks is an array containing the marks of the core subjects out of 100. Internal marks calculation is different for different categories of students. Internal marks (out of 100) for B.E students can be calculated as 50% of test1 + 50% of test2 (Considering two best tests out of three) Internal marks (out of 100) for MCA students can be calculated as 40% of test1 + 30% of test2 + 30% of test3 (Considering all the three tests) Read and display the details of the Student with the operator overloading (<<, >>) Implement Calculate() in two different categories of the students and invoke them. (Use Virtual Function) Write the details of at least one category of the students in a binary file and show the details by reading from the file. DFS() to perform depth first search on the graph. (30)

(II) 1. Develop a payroll application to compute the salary for the employees in an organization. Class Employee has general information namely employee_id, employee name, department_name, address, mobile number and email id. There are two types of employees such as training professionals and regular employees. The Definition of Pay_calculate() will be different for different types of employees. Include suitable menu for navigating the application. Training professionals has total teaching experience, qualification, no_of_sessions_handled. Salary = no_of_sessions_handled*one_day_salary (Both can be randomized values) Regular employees has department they belong to, basic_pay, designation Gross Pay = basic_pay+hra+da Net Pay = Gross Pay PF HRA = 9% of Basic Pay, DA = 90% of Basic Pay, PF = 20% of Basic Pay SNo Designation Basic_Pay 1 Manager 30000 2 Technical Lead 25000 3 Senior Software Engineer 20000 4 Software Engineer 15000 Get and display details of different types of employees using operator overloading(<<, >>) Write suitable exceptions for the given scenario. (10) Write a friend function LiseDeptWise() to list all employees for a given department_name. Prim s Algorithm to construct minimum spanning tree. (40)

III 1. Develop a banking application to computerize the operations in the bank. Account holder has general information that they require to provide are account_id, acct_holder_name, address, mobile number and email id. There are two types of account holders such as savings account & current account. Interest calculation definition will be different for different types of account holders. Include suitable menu for navigating the application. Savings account holder has purpose_of_account & balance Current savings account holder has type_of_business & balance Interest calculation will be done on the current balance. Interest calculation for savings account Interest = balance*8% of balance Interest calculation for current account Interest = balance*12% of balance Get and display details of different categories of account holders using operator overloading(<<, >>) Write suitable exceptions for the given scenario. (10) Implement the interest_calc method in two different types of account holders and invoke them. (Virtual Function) 2. Create a class BST with the data members node which is of type structure. This structure consists of the members element of type integer, left and right which are of type pointer to the structure node. The other data member for the class is root which is a pointer to the node structure. Write the following member functions Insert() To insert an element into the binary search tree Search() To search for a given element in the tree (10) Inorder() To perform inorder traversal for tree (10) FindMin() To find the minimum element in the tree (10) (IV) 1.Create class matrix with the data members 2D array, row and column of type integer. Overload the following operators and write the operator functions necessarily as member or friend of the class matrix. >>(extraction operator) to read the values for the data members (10) << (insertion operator) to display the values of the data members (10) + (addition operator) to add two matrices (10) (unary minus) to negate the values of a matrix (10) ++(pre and post increment operator) to increment the values of the data members of a matrix (10) Write the main() program to demonstrate the matrix object for unary and binary operator overloading. Prim s Algorithm to construct minimum spanning tree. (40)

(V) 1.Design a class Array as a template class with a single dimensional array and size of the array as data members. Template class need to work for different types of input (integer, float, char, char array, string, student, employee). Include the following member functions getarray() and printarray() to read and print the elements of the array (10) sort()the array elements using bubble sort algorithm. To enable sorting employee or student objects based on a data member. Dijkstra s algorithm to solve the single source shortest path problem. (40) (VI) 1. Create a class student with the data members roll number, name, marks array to hold marks for 5 subjects, total and a Boolean variable pass. Keep the following member functions in the class. Void Read() To read the data members Void Print() To print the data members Void Result() Computes the total and pass. Pass variable will be true if all the marks are >=50, otherwise, it is false. Write a function template to sort the input values of type integer, float, char array, string and Student objects. Student objects need to be sorted based on their total. To sort integer, float and string values. (10) To sort strings made up of character array. (10) To sort student object based on the total. (10) 2. A stack is a linear list of elements for which all insertions and deletions (usually accesses) are made at only one end of the list. Create a class with the data members integer array and the size. Write the following member functions and write menu driven () program to use those functions. Push (int X): pushes an element X on to the top of the stack This function uses the IsFull() member function while pushing the data. (10) int Pop(): pops the last pushed element. This function uses the IsEmpty() member function while popping the data from the stack. (10) void Display(): to display the elements in the stack. (10) Write a program to find whether the given string is palindrome or not. (Use stack class).

(VII) 1.Create a class Complex with the data members real and imaginary of integer type. Read two complex numbers and store them in a file.. Read and print the complex numbers using stream operators. (<<, >>). Operator + () to perform complex number addition. (10) Open the file, read complex numbers using input file stream and perform complex number addition. Store the resultant complex number in another file. (Use binary file stream). (10) 2. Create a class BST with the data members node which is of type structure. This structure consists of the members of type integer, left and right which are of type pointer to the structure node. The other data member for the class is root which is a pointer to the node structure. Write the following member functions Insert() To insert an element into the binary search tree Preorder() To perform preorder traversal for tree (10) FindMax() To find the maximum element in the tree (10) (VIII) 1. Create a class student with the data members roll number, name, marks array to hold the three UT marks for the subject PDS II, attendance (out of 5) and internal marks. Keep the following member functions in the class. To read and display the data members of student class. (10) Compute_Internal() Computes the internal marks. (10) Create a binary file student.dat and insert 10 student objects in it. Find() To find the student record given the position of it. DFS() to perform depth first search on the graph. (30)

(IX)1. A Queue is a linear list of elements where an element will be inserted at the back end and deleted at the front end. Create a class queue with the data members integer array, front and rear. Include the following member functions in the class queue and write a menu driven (1. Insert, 2. Delete, 3. Display, 4. Exit) program to use the class queue. Write suitable exceptions for the given scenario. (10) bool IsEmpty(): return whether the queue is empty or not (10) bool IsFull(): return whether the queue is full or not. (10) Insert (int X): inserts an element X into the back end of the queue This function uses the IsFull() member function while inserting the data. (10) int Delete(): removes the element from the front end. This function uses the IsEmpty() member function while deleting the data from the queue. (10) void Display(): to display the elements in the queue. (10) BFS() to perform breadth first search on the graph (use queue class). (30) (X) 1. Create a class person with a data member namelist whose type is a double pointer. Memory space for this double pointer is allocated in the constructor of the class. Write a destructor to de allocate the memory of the character array. Include the following member functions: Read(), Disp() to read and display the data member namelist Create suitable constructor and destructor for the class person. Copy constructor to copy data members from one object to the other. DFS() to perform depth first search on the graph. (30) (XI) 1. Consider an example of declaring the examination result. Design three classes: Student, Exam and Result. The student class has data members such as roll number, name and address. Create the class Exam by inheriting the Student class. The Exam class adds data members to representing the marks scored in six subjects. Derive the Result class from the Exam class and it has its own data member result which is of type bool. Include getresult() in Result class to set the corresponding value (true or false) based on the marks of the students given in Exam class. Write an interactive program to model this relationship Write a friend class to maintain the collection of result objects and include a member function to list the student details such as roll number, name, address, marks for six subjects based upon the result. (30) Kruskal s Algorithm to construct minimum spanning tree (40)

(XII) 1. Create a class called Circle with radius as data member and getcircle() and calcarea() as member functions to read the radius and calculate area of the circle. (10) Create a class called Cone which is derived from the Circle class. Utilize the data members and the member functions of the base class by the derived class to find the volume ((1/3)*3.14*r*r*h) of a cone. Create another class called Cylinder which is derived from the Circle class. Utilize the data members and the member functions of the base class by the derived class to find the volume (3.14*r*r*h) of a cylinder. (10) Get and retrieve the data members of cone and cylinder using operator overloading Use virtual function to find volume of the cone and cylinder and invoke them (10) 2. Create a class BST with the data members node which is of type structure. This structure consists of the members element of type integer, left and right which are of type pointer to the structure node. The other data member for the class is root which is a pointer to the node structure. Write the following member functions Insert() To insert an element into the binary search tree Delete() To delete a given element from the tree Preorder() To perform preorder traversal for tree (10) (XIII) 1. Create a class matrix with the data members **m, row and column of type integer. Write the following member functions Overload stream operators (<<, >>) to read and display the matrix Overload binary minus ( ) operator to subtract one matrix from the other (10) Overload unary minus ( ) operator to subtract the values of the elements of a given matrix (10) Allocate memory for the data member m using constructor (10) Deallocate the memory for m using destructor (10) Create_Graph() to represent the graph using Adjacency matrix (10) DFS() to perform depth first search on the graph (30) (XIV) 1.Write a program to create a list container to maintain a set of integer elements and employee objects where an employee object consists of the data members name and empno. Implement the following Create a list of integer elements into the list container (10) Insert into a list with the new element in the given required position (10) Create a list of employee objects into the list container (10) Insert into a list with a new employee object in the given required position Display the list the employee objects from the List container (10) 2. Create a class BST with the data members node which is of type structure. This structure consists of the members of type integer, left and right which are of type pointer to the structure node. The other data member for the class is root which is a pointer to the node structure. Write the following member functions Insert() To insert an element into the binary search tree Delete() To delete a given element from the tree (10) Postorder() To perform postorder traversal for tree (10)

(XV) 1. Create a class Time to display a time value with the data members of hours, minutes and seconds. Include the following member functions to get and display the time separated by: (HH:MM:SS). Assume the time is represented in 12 hours. (10) If the input value exceeds the hour, minute and second then your function should report the exception as invalid hour/minute/second. Write an operator function binary minus ( ) to find which time is later. For example invoking T1 T2 displays T1 is later or T2 is later Adjacency matrix creation (10) Kruskal s Algorithm to construct minimum spanning tree (40) (XVI) 1. Create a class Student with the data members rollno, *name, mark array containing marks for maths and science subjects and cutoff mark. Include member function calculate_cutoff() to find cutoff where cut off mark is calculated as ((maths+science)/200)*80. (10) Create another class Sports with the data members name, level, sports_mark. Level data member represents the national or international level player. Include member function calculate_sportsmark() to assign sports_mark to be 10 if national player, otherwise 20. (10) Create another class Sports_Student derived from both the student and the sports with data member total_cutoff and calculate total_cutoff() to add the cutoff and the sports_mark. (10) Write suitable exceptions for the given scenario (10) Allocate memory for the data member m using constructor (10) Deallocate the memory for m using destructor (10) DFS() to perform depth first search on the graph. (30) (XVII) 1. Write a program to create a map container to maintain a set of key, value pairs, where key is integer element and student object and value is the GATE score (out of 100). Student object has the data members rollno and name. Display the elements of the map container. Create a map container with 10 key,value pairs where key is the integer element and value is the GATE score (10) Display the integer key, value pairs from the Map container (10) Create a map container with 10 key, value pairs where key is the student object and the value is the GATE score Display the student key, value pairs from the Map container (10) Floyd Warshall algorithm to find the shortest path between every pair of vertices in the graph (40)

(XVIII) 1. Create a class employee with the data member empno. Create a class gross_salary which is derived from employee with the data members basic_pay, DA (92% of basic_pay), HRA (22% of basic_pay) of type float and the member function to compute gross_pay (i.e basic_pay + DA + HRA). Another class deduction that is derived from employee has the data members PF, medi_claim and the member function to compute deducted_amount (i.e PF + medi_claim). A class net_salary that is derived from both gross_salary and deduction has the data member net_pay and the member function to compute net_pay (i.e gross_pay deducted_amount). Model this hierarchy using inheritance (10) Read and display the data members for the object result (use operator (<<, >>) overloading) Write compute_total() to find the total marks by adding part1, part2 and sports_mark (10) Write suitable exceptions for the given scenario (10) 2. Create a class Graph with the data member 2D array and the number of nodes of type integer. Write the member functions to implement Adjacency matrix creation (10) Kruskal s Algorithm to construct minimum spanning tree (40) (XIX) 1. Write program to calculate the area of polygons namely, Square, Rectangle, Triangle, Equilateral Triangle, Parallelogram, Trapezoid and circle. (Use function overloading) Area of the polygons is given below. Square A = side * side, where side is in integer variable Rectangle = length * breadth, where length and breadth are integers Circle = pi * radius * radius, where radius is a float variable Triangle = 0.5 * breadth * height, where breadth and height are integer and float variables Equilateral Triangle = 0.5 * breadth * height, where breadth and height are float and integer variables Trapezoid = base1 * base2 * height, base1, base2 and height are integer variables o Write main() program to demonstrate the function overloading (30) o Create a text file sample.txt. Write ten sentences into sample.txt, read and display them by opening it in read mode. Adjacency matrix creation (10) Kruskal s Algorithm to construct minimum spanning tree (40) (XX) 1. Create a class person with the data members *name, address of type character array. Create a class employee derived from class person with the data members basic pay, allowances, pf, gross and netpay of type integer. Create a class student derived from class person with the data members course, grade. Create a class parttime_student derived from student and employee with the data members stipend and total_income of type integer. Model this relationship using inheritance. Write a program to demonstrate the type of inheritance Allocate memory for the data member name using constructor (10) Deallocate the memory for name using destructor (10) Write suitable exceptions for the given scenario (10) Adjacency matrix creation (10) Prim s Algorithm to construct minimum spanning tree (40)