Assignment
Assignment
Private members:
bcode 4 digits code number
bname 20 characters
innings, notout, runs integer type
batavg it is calculated according to the formula –
batavg =runs/(innings-notout)
calcavg() Function to compute batavg
Public members:
readdata() Function to accept value from bcode, name, innings,
notout and invoke the function calcavg()
displaydata() Function to display the data members on the screen.
2) Write a program to calculate the monthly telephone bills as per the following
rule:
Minimum Rs. 200 for upto 100 calls.
Plus Rs. 0.60 per call for next 50 calls.
Plus Rs. 0.50 per call for next 50 calls.
Plus Rs. 0.40 per call for any call beyond 200 calls.
Free 100 SMS above it 0.35 per SMS
1 GB Data Free after that 1.60 per MB.
Add 18% Tax on Total Bill.
Create Class MobileBill, Use Functions for calculation, Input data &
Display Bill. Input number of Calls from, Number of SMS & Data Used
from user.