BPLCK105D
BPLCK105D
Module-1 (8 hours)
Functions in C++: Tokens – Keywords – Identifiers and constants – Operators in C++ – Scope
resolution operator – Expressions and their types – Special assignment expressions – Function
prototyping – Call by reference – Return by reference – Inline functions -Default arguments –
Function overloading.
Module-4 (8 hours)
I/O Streams: C++ Class Hierarchy- File Stream-Text File Handling- Binary File Handling during file
operations.
1
16-2-2023
Module-5 (8 hours)
Exception Handling: Introduction to Exception - Benefits of Exception handling- Try and catch
blockThrow statement- Pre-defined exceptions in C++
CO3
Achieve code reusability and extensibility by means of Inheritance and
Polymorphism
CO4
Implement the features of C++ including templates, exceptions and file handling for
providing programmed solutions to complex problems.
Programming Assignments:
1. Write a C++ program to sort the elements in ascending and descending order.
2. Write a C++ program to find the sum of all the natural numbers from 1 to n.
3. Write a C++ program to swap 2 values by writing a function that uses call by reference technique.
4. Write a C++ program to demonstrate function overloading for the following prototypes.
add(int a, int b)
add(double a, double b)
5. Create a class named Shape with a function that prints "This is a shape". Create another class named
Polygon inheriting the Shape class with the same function that prints "Polygon is a shape". Create two
other classes named Rectangle and Triangle having the same function which prints "Rectangle is a
polygon" and "Triangle is a polygon" respectively. Again, make another class named Square having
the same function which prints "Square is a rectangle".Now, try calling the function by the object of
each of these classes.
6.Suppose we have three classes Vehicle, FourWheeler, and Car. The class Vehicle is the base class,
the class FourWheeler is derived from it and the class Car is derived from the class FourWheeler. Class
Vehicle has a method 'vehicle' that prints 'I am a vehicle', class FourWheeler has a method
'fourWheeler' that prints 'I have four wheels', and class Car has a method 'car' that prints 'I am a car'.
So, as this is a multi-level inheritance; we can have access to all the other classes methods from the
object of the class Car. We invoke all the methods from a Car object and print the corresponding
outputs of the methods.
So, if we invoke the methods in this order, car(), fourWheeler(), and vehicle(), then the output will be
2
16-2-2023
I am a car
I have four wheels
I am a vehicle
Write a C++ program to demonstrate multilevel inheritance using this.
7. Write a C++ program to create a text file, check file created or not, if created it will write some text
into the file and then read the text from the file.
8.Write aC++ program to write and read time in/from binary file using fstream
9. Write a function which throws a division by zero exception and catch it in catch block. Write a C++
program to demonstrate usage of try, catch and throw to handle exception.
10. Write a C++ program function which handles array of bounds exception using C++.
3
16-2-2023
The laboratory test (duration 03 hours) at the end of the 15th week of the semester
/after completion of all the experiments (whichever is early) shall be conducted for 50
marks and scaled down to 05 marks.
Scaled-down marks of write-up evaluations and tests added will be CIE marks for the laboratory
component of IC/IPCC for 20 marks.
The minimum marks to be secured in CIE to appear for SEE shall be 12 (40% of maximum
marks) in the theory component and 08 (40% of maximum marks) in the practical
component. The laboratory component of the IC/IPCC shall be for CIE only. However, in
SEE, the questions from the laboratory component shall be included. The maximum of 05
questions is to be set from the practical component of IC/IPCC, the total marks of all
questions should not be more than 25 marks.
The theory component of the IC shall be for both CIE and SEE.
Semester End Examination (SEE):
SEE for IC
Theory SEE will be conducted by University as per the scheduled time table, with common question
papers for the course (duration 03 hours)
1. The question paper will have ten questions. Each question is set for 20 marks.
2. There will be 2 questions from each module. Each of the two questions under a module (with a
maximum of 3 sub-questions), should have a mix of topics under that module.
3. The students have to answer 5 full questions, selecting one full question from each module.
The theory portion of the Integrated Course shall be for both CIE and SEE, whereas the practical
portion will have a CIE component only. Questions mentioned in the SEE paper shall include
questions from the practical component).
Passing standard:
The minimum marks to be secured in CIE to appear for SEE shall be 12 (40% of maximum marks-
30) in the theory component and 08 (40% of maximum marks -20) in the practical component.
The laboratory component of the IPCC shall be for CIE only. However, in SEE, the questions from
the laboratory component shall be included. The maximum of 04/05 questions to be set from the
practical component of IPCC, the total marks of all questions should not be more than 30 marks.
SEE will be conducted for 100 marks and students shall secure 35% of the maximum marks to
qualify for the SEE. Marks secured will be scaled down to 50.
4
16-2-2023
Tutorial Link:
1. https://www.w3schools.com/cpp/cpp_intro.asp
2. https://www.edx.org/course/introduction-to-c-3
Level 3- Highly Mapped, Level 2-Moderately Mapped, Level 1-Low Mapped, Level 0- Not Mapped