Skip to main content

C++

INTRODUCTION TO OOP,CLASSES & OBJECTS

1.Use of scope Resolution of Operators.
2.Define a function outside a using scope resolution operators.
3.Write a program to calculate the area of circle, rectangle and square using function overloading.
4.Write a program to calculate the area of circle, rectangle and square using with class & object.
5.Write a program to demonstrate the use of returning a reference variable.
6.Create a class student,stores the details about name,roll no,marks of 5 subject,1.get function accept value of data members,2. display function to display,3.total function to return total of 5 subjects marks.
7.Create function power() in c++. & Create function power() in c++ and default argument.
8.Write a C++ program to swap the value of private data members from 2 different classes.
9.Write a program to illustrate the use of this pointer.
10.An election is contested by five candidates. The candidates are numbered 1 to 5 and the voting is done by marking the candidate number on the ballot paper. Write a program to read the ballots and count the votes cast for each candidate using an array variable count. In case a number is read outside the range of 1 to 5, the ballot should be considered as a ‘spoilt ballot’ and the program should also count the number of spoilt ballots.
11.Write a program to call member functions of class in the main function using pointer to object and pointer to member function.

DYNAMIC MEMORY MANAGEMENT,CONSTRUCTOR & DESTRUCTOR,INHERITANCE

1.Using friend function find the maximum number from given two numbers from two different classes. Write all necessary functions and constructors for the program.
2.Using a friend function, find the average of three numbers from three different classes. Write all necessary member functions and constructor for the classes.
3.Define currency class which contains rupees and paisa as data members. Write a friend function named AddCurrency ( ) which add 2 different Currency objects and returns a Currency object. Write parameterized constructor to initialize the values and use appropriate functions to get the details from the user and display it.
4.Create Calendar class with day, month and year as data members. Include default and parameterized constructors to initialize a Calendar object with a valid date value. Define a function AddDays to add days to the Calendar object. Define a display function to show data in “dd/mm/yyyy” format.
5.Create a class named ‘String’ with one data member of type char *, which stores a string. Include default, parameterized and copy constructor to initialize the data member. Write a program to test this class.
6.Write a base class named Employee and derive classes Male employee and Female Employee from it. Every employee has an id, name and a scale of salary. Make a function ComputePay (in hours) to compute the weekly payment of every employee. A male employee is paid on the number of days and hours he works. The female employee gets paid the wages for 40 hours a week, no matter what the actual hours are. Test this program to calculate the pay of employee.
7.Create a class called scheme with scheme_id, scheme_name,outgoing_rate, and message_charge. Derive customer class form scheme and include cust_id, name and mobile_no data.Define necessary
functions to read and display data. Create a menu driven program to read call and message information for a customer and display the detail bill.

8.Write a program with use of inheritance: Define a class publisher that stores the name of the title. Derive two classes book and tape, which inherit publisher. Book class contains member data called page no and tape class contain time for playing. Define functions in the appropriate classes to get and print the details.
9.Create a class account that stores customer name, account no,types of account. From this derive classes cur_acc and sav_acc to include necessary member function to do the following:
• Accepts deposit from customer and update balance
• Compute and Deposit interest
• Permit withdrawal and Update balance.

VIRTUAL FUNCTIONS,OPERATORS OVERLOADING

1.Create a class vehicle which stores the vehicleno and chassisno as a member. Define another class for scooter,which inherits the data members of the class vehicle and has a data member for a storing wheels and company. Define another class for which inherits the data member of the class vehicle and has a data member for storing price and company. Display the data from derived class. Use virtual function.
2.Create a base class shape. Use this class to store two double type values that could be used to compute the area of figures. Derive two specific classes called triangle and rectangle from the base shape. Add to the base class, a member functionget_data() to initialize the base class data members and another member function display_area() to compute and display the area of figures. Make display_area() as a virtual function and redefine this function in the derived class to suit their requirements.
3.Write a program to demonstrate the use of pure virtual function.
4.For multiple inheritance, write a program to show the invocation of constructor and destructor.
5.Create a class string with character array as a data member and write a program to add two strings with use of operator overloading concept.
6.Create a class distance which contains feet and inch as a data member. Overhead = =, operator for the same class.Create necessary functions and constructors too.
7.Create a class MATRIX of size mxn. Overload + and – operators for addition and subtraction of the MATRIX
8.Define a class Coord, which has x and y coordinates as its data members. Overload ++ and – operators for the Coord class. Create both its prefix and postfix forms.
9.Create one class called Rupees, which has one member data to store amount in rupee and create another class called Paise which has member data to store amount in paise. Write a program to convert one amount to another amount with use of type conversion.
10.Create two classes Celsius and Fahrenheit to store temperature in terms of Celsius and Fahrenheit respectively.Include necessary functions to read and display the values.Define conversion mechanism to convert Celsius object to Fahrenheit object and vice versa. Show both types of conversions in main function

TEMPLATES , INPUT/OUTPUT & FILES

1.Write a program to create a function template for finding maximum value contained in an array.
2.C++ Class Template for the Array Class.
3.Template BUBBLE SORT Function in C++.
4.Text mode Output using INSERTION "<<" Operator.
5.Text mode Input using EXTRACTION ">>" Operator.
6.Text mode Output using put() function & Input get() function.
7.Text mode Input using getline() function.
8.Binary Output using write() function.
9.Binary Input using read() function.

Comments

Popular posts from this blog

BCA SEM 5 SHELL SCRIPT PROGRAM

1  Write a shell script to execute following commands 1. Sort file abc.txt and save this sorted file in xyz.txt 2. Give an example of : To execute commands together without affecting result of each other. 3. How to print “this is a three –line 1. Text message” 4. Which command display version of the UNIX? 5. How would u get online help of cat command? echo “sorting the file” sort abc.txt > xyz.txt echo “executing two commands” who ; ls echo “this is \n a three-line \n Text message” # use -e option if required echo “The version is `uname -a`” echo “Help of cat command” man cat 2  Write a shell script to execute following commands 1. How would u display the hidden files? 2. How delete directory with files? 3. How would user can do interactive copying? 4. How would user can do interactive deletion of files? 5. Explain two functionality of “mv” command with example? echo “1. How would u display the hidden files” echo “2. How delete directory with files” echo “3. How

USER- DEFINED FUNCTIONS

1. Write a program to calculate average temperature of five days.Create temp() function . 2. Write a program that uses recursive function fibo() thatgenerates a Fibonacci series containing N elements. 3. Write a program that uses a recursive function fact() that findsthe factorial of a given number N. 4. Program to find if the given no. is prime or not. The functionshould accept the number as argument and return if the no. isprime or not. 5. Write a function that accepts an array of integer values. Thefunction should find the number which divides all the othernumbers. 6. Write a user-defined function to perform Square of a number 7. Write a user-defined function to perform Area of a number 8. Write a user-defined function to perform Reverse the number 9. Write a program that uses a function to check whether anentered three digit number is palindrome or not. 10. Write a program to calculate the result of following with recursive calls offunction. 11. Simple interset with usin