You are on page 1of 2

FALL Semester 2020-21

Digital Assignment – 1
Programme Name: BCA Slot: B1 + TB1
Course Code: ITA3001 Course Title: OOP Theory
Faculty Name: Dr. Chandra Mouliswaran S. Maximum Marks: 10

ANSWER ALL QUESTIONS (LAST DATE FOR SUBMISSION: 10.08.2020 FRIDAY)

1. Create a C++ class describing a Resistor with the following


members:

i) private data members for the resistance, R, E, I.


ii) a public member function to set the value of R
iii) a public member function to calculate the current I from
the voltage E
iv) a public member function to calculate the voltage E from
the current I
v) a public member function to calculate the power
dissipation P from the current I using the formula P = I·E,
where E is calculated using the previous member function.

Write a C++ program to test the above class.

2. An Insurance Company applies the following rules to calculate the


premium.

i) If a person’s health is excellent and the person is between 25


and 35 years of age and lives in a city and is a male, then the
Page 1 of 2
premium is $4 per thousand and his policy amount cannot
exceed Rs.200, 000.

ii) If person satisfies all the above conditions except that the
person is a female then the premium is $3 per thousand and
her policy amount cannot exceed $100,000.
iii) If the person health is poor and the person is between 25 and
35 years of age and lives in a village and is a male then the
premium is $6 per thousand and his policy cannot exceed
$10,000.
iv) In all the other cases the person is not insured.

Write a C++ program using classes to output whether the person


should be insured or not, his/her premium rate and minimum
amount for which he/she can be insured.

3. i) Compare and contrast structured (procedural-oriented) and


object oriented programming.

ii) Explain the different types of Constants, Variables and their


Declarations in C++.

iii) How will you identify no. of objects created in an application?

iv) List out the different access rule to access the various data
members and member function through object name and class
name.

v) Why destructors cannot be overloaded?

*** ALL THE BEST ***

Page 2 of 2

You might also like