|Course Code :||BCS-031|
|Course Title :||Programming In C++|
|Assignment Number :||BCA(3)/031/Assignment/2019-20|
|Maximum Marks :||100|
|Last Date of Submission :||15th October, 2019 (for July 2019 session)
15th April, 2020 (for January 2020 session)
|Solution Type :||Softcopy (PDF File)|
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 presentation. Wherever required, you may write C++ program and take its output as part of solution.
- (a) Differentiate between Object Oriented Programming approach and Structured Programming Approach.Also explain advantages of Object Oriented Programming over Structured Programming.
(b) Explain different data types available in C++ programming language.
(c) Explain the use of followings in C++ programming with an example program for each.
If, while, switch
- (a) What is constructor? Define the class Account with all the basic attributes of a saving bank account. Define the default constructor, parameterised constructor in Account class. Define member functions display_balance(),for displaying the balance of account and cash_withdrawal( ) to withdraw some amount from account. Use appropriate access control specifiers in this program.
(b) Explain the following in detail, in 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 ‘+’ operator to find the sum of 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 stream manipulator? Explain use of setw( ) and setprecision( ) as streammanipulator.
(b) Write a C++ program to read the contents of a file and display it on console.
(c) What is an exception? Explain advantages of exceptions handling .Write a program in C++ to perform simple arithmetic operations with proper exceptions handling.
- (a) What is template?Write appropriate statements to create a template class for Stack data structurein C++
(b) What is polymorphism? Explain different types of polymorphism with examples.
(c) Write C++ program to demonstrate implementation of friend function. Also explain advantages of friend function.
All questions are solved in this assignment solution.