Object Oriented Programming Lab
Savitribai Phule Pune University
Second Year of Computer Engineering (2015 Course)
210248: Object Oriented Programming Lab
List of Lab Assignments[Click to see the videos]
- 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.
- Implement a class Quadratic that represents degree two polynomials i.e., polynomials of typeax2+bx+c. The class will require three data members corresponding to a, b and c. Implementthe following operations:1. A constructor (including a default constructor which creates the 0 polynomial).2. Overloaded operator+ to add two polynomials of degree 2.3. Overloaded << and >> to print and read polynomials. To do this, you will need todecide what you want your input and output format to look like.4. A function eval that computes the value of a polynomial for a given value of x.5. A function that computes the two solutions of the equation ax2+bx+c=0.
- Write a C++ program create a calculator for an arithmetic operator (+, -, *, /). The programshould take two operands from user and performs the operation on those two operandsdepending 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 / 3Answer = 3.333333Do another (y/n)? yEnter first number, operator, second number: 12 + 100Answer = 112Do another (y/n)? n
- Develop an object oriented program in C++ to create a database of student informationsystem containing the following information: Name, Roll number, Class, division, Date ofBirth, Blood group, Contact address, telephone number, driving license no. etc Construct thedatabase with suitable member functions for initializing and destroying the data vizconstructor, default constructor, Copy constructor, destructor, static member functions, friendclass, this pointer, inline code and dynamic memory allocation operators-new and delete.
- Write a function in C++ to count and display the number of lines not starting withalphabet 'A' present in a text file "STORY.TXT".Example:If the file "STORY.TXT" contains the following lines, The roses are red. A girl is playing there.There is a playground.An aeroplane is in the sky.Numbers are not allowed in the password.The function should display the output as 3.
- 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 requireddata & print bio-data. Create bio-data using multiple inheritance using C++.
- Create User defined exception to check the following conditions and throw the exception if thecriterion does not meet.a. User has age between 18 and 55b. User stays has income between Rs. 50,000 – Rs. 1,00,000 per monthc. User stays in Pune/ Mumbai/ Bangalore / Chennaid. User has 4-wheelerAccept age, Income, City, Vehicle from the user and check for the conditions mentionedabove. If any of the condition not met then throw the exception.
- Write a menu driven program that will create a data file containing the list of telephonenumbers 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 followingtasksI. Determine the telephone number of specified personII. Determine the name if telephone number is knownIII. Update the telephone number, whenever there is a change
- Write a C++ program that creates an output file, writes information to it, closes the file andopen it again as an input file and read the information from the file
- Write a function template selection Sort. Write a program that inputs, sorts and outputs aninteger array and a float array.
- Write C++ program using STL for implementation of stack & queue.
- Write C++ program using STL to add binary numbers (assume one bit as one number); useSTL stack.
- Write C++ program using STL for Dqueue (Double ended queue)
0 Comments