|Course Title||Programming in C++|
|Last Date of Submission||15th October 2019 (For July 2019 Session)|
|15th April 2020 (For January 2020 Session)|
This assignment has five questions carrying a total of 80 marks. Answer all the questions. Rest 20 marks are for viva-voce. You may use illustrations and diagrams to enhance explanations. Please go through the guidelines regarding assignments given in the Programme Guide for the format of the presentation. Wherever required, you may write the C++ program and take its output as part of the solution.
(a) Differentiate between Object-Oriented Programming approach and Structured Programming Approach. Also, explain the advantages of Object-Oriented Programming over Structured Programming.
(b) Explain different data types available in the C++ programming language.
(c) Explain the use of followings in C++ programming with an example program for each.
(a) What is a constructor? Define the class Account with all the basic attributes of a saving bank account. Define the default constructor, the parameterized constructor in Account class. Define member functions display_balance(), for displaying the balance of account and cash_withdrawal( ) to withdraw some amount from the account. Use appropriate access control specifiers in this program.
(b) Explain the following in detail, in the context of C++ programming.
i. Access Specifiers
ii. Virtual Function
iii. Abstract Class
(a) What is inheritance? Explain different types of inheritance supported by C++ with the help of example programs.
(b) Write a C++ program to overload the ‘+’ operator to find the sum of the length of two given strings. (Note: if S1 and S2 are two strings then S1+S2 should give the sum of lengths of S1 and S2).
(a) What is a stream manipulator? Explain use of set( ) and set precision( ) as stream
(b) Write a C++ program to read the contents of a file and display it on a console.
(c) What is an exception? Explain the advantages of exceptions handling. Write a program in C++ to perform simple arithmetic operations with proper exceptions handling.
(a) What is a template? Write appropriate statements to create a template class for a Stack data structure in C++.
(b) What is polymorphism? Explain different types of polymorphism with examples.
(c) Write a C++ program to demonstrate the implementation of a friend function. Also, explain the advantages of friend function.