Thursday, 15 September 2016

Object oriented programming

               

Subject:  OOP (Object Oriented Programming) Programs

Second Year (Sem 1 Practical Program Set)

(According to 2016 New Syllabus)

Download The file from here (G Drive)

File Contains : Following University Questions :

1. Implement a class Complex which represents the Complex Number data type. Implement the
following operations:
1. Constructor (including a default constructor which creates the complex number 0+0i).
2. Overloaded operator+ to add two complex numbers.
3. Overloaded operator* to multiply two complex numbers.
4. Overloaded << and >> to print and read Complex Numbers.Download This Program


2. Write a C++ program create a calculator for an arithmetic operator (+, -, *, /). The program
should take two operands from user and performs the operation on those two operands
depending upon the operator entered by user. Use a switch statement to select the operation.
Finally, display the result.
Some sample interaction with the program might look like this:
Enter first number, operator, second number: 10 / 3
Answer = 3.333333
Do another (y/n)? y
Enter first number, operator, second number: 12 + 100
Answer = 112
Do another (y/n)? n    


3.Develop an object oriented program in C++ to create a database of student information
system containing the following information: Name, Roll number, Class, division, Date of
Birth, Blood group, Contact address, telephone number, driving license no. etc Construct the
database with suitable member functions for initializing and destroying the data viz
constructor, default constructor, Copy constructor, destructor, static member functions, friend
class, this pointer, inline code and dynamic memory allocation operators-new and delete.







5A book shop maintains the inventory of books that are being sold at the shop. The list includes

details such as author, title, price, publisher and stock position. Whenever a customer wants a
book, the sales person inputs the title and author and the system searches the list and displays
whether it is available or not. If it is not, an appropriate message is displayed. If it is, then the
system displays the book details and requests for the number of copies required. If the
requested copies book details and requests for the number of copies required. If the requeste
copies are available, the total cost of the requested copies is displayed; otherwise the message
―Required copies not in stock‖ is displayed. Design a system using a class called books with
suitable member functions and Constructors. Use new operator in constructors to allocate
memory space required. Implement C++ program for the system.





6.Create employee bio-data using following classes i) Personal record ii))Professional record iii)
Academic record Assume appropriate data members and member function to accept required
data & print bio-data. Create bio-data using multiple inheritance using C++.



7.Crete User defined exception to check the following conditions and throw the exception if the

criterion does not meet.
a. User has age between 18 and 55
b. User stays has income between Rs. 50,000 – Rs. 1,00,000 per month
c. User stays in Pune/ Mumbai/ Bangalore / Chennai
d. User has 4-wheeler
Accept age, Income, City, Vehicle from the user and check for the conditions mentioned
above. If any of the condition not met then throw the exception.



8.
Write a menu driven program that will create a data file containing the list of telephone
numbers in the following form
John 23456
Ahmed 9876
........... .........
Use a class object to store each set of data, access the file created and implement the following
tasks
I. Determine the telephone number of specified perso
II. Determine the name if telephone number is known
III. Update the telephone number, whenever there is a change.



9. Write a C++ program that creates an output file, writes information to it, closes the file and

open it again as an input file and read the information from the file.



10.Write a function template selection Sort. Write a program that inputs, sorts and outputs an

integer array and a float array.


11.Write C++ program using STL for implementation of Singly, doubly and circular linked list.


12. Write C++ program using STL for implementation of stack & queue using SLL


13. Write C++ program using STL to add binary numbers (assume one bit as one number); use

STL stack.     
14. Write C++ program using STL for Dqueue (Double ended queue)  
15.
Write C++ program using STL for Sorting and searching with user-defined records such as
Person Record (Name, birth date, telephone no), item record (item code, item name, quantity
and cost)














No comments:

Post a Comment