Page 6 - C++
P. 6
(i) Give the name of the feature of OOP which is implemented by Function 1 &
2 together in the above class Game.
(ii) Anuj made changes to the above class Game and made Function 3 private.
Will he be able to execute the Line 1 successfully given below? Justify.
void main()
{
Game ABC; //Line 1
}
(c) Define a class Bill in OOP with the following specification:- 4
Private members:
1. Bill_no - type long(bill number)
2. Bill_period - type integer(number of months)
3. No_of_calls - type integer(number of mobile calls)
4. Payment_mode - type string(“online” or “offline”)
5. Amount - type float(amount of bill)
6. Calculate_Bill() function to calculate the amount of bill given as per the
following conditions:
Calculation Rate/call
No_of_calls
(in rupees)
<=500 1.0
501-1200 2.0
>1200 4.0
Page No. 4