0% found this document useful (0 votes)
34 views

Assignment

The document describes two classes: 1) A batsman class with private data members like code, name, innings played, not outs, runs scored. It has public functions to read data, calculate batting average, and display data. 2) A mobile bill class to calculate monthly charges based on number of calls, SMS, and data used. It calculates bill amounts based on slab rates and adds 18% tax on total. It takes inputs and uses functions to calculate and display the final bill.

Uploaded by

Vishal Verma
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Assignment

The document describes two classes: 1) A batsman class with private data members like code, name, innings played, not outs, runs scored. It has public functions to read data, calculate batting average, and display data. 2) A mobile bill class to calculate monthly charges based on number of calls, SMS, and data used. It calculates bill amounts based on slab rates and adds 18% tax on total. It takes inputs and uses functions to calculate and display the final bill.

Uploaded by

Vishal Verma
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1) Define a class batsman with the following specifications:

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.

You might also like