File Assignment 1. Chap Functions
File Assignment 1. Chap Functions
Please write make one separate file you may take printouts of
questions, solve every program after question. Comments,
variable table is compulsory. Neat and tidy work is expected.
As this work will be submitted to board for internal
assessment.
(Generally it is question no 4 in board paper)
(Board paper 2005)
Q1. Write a class with name employee and basic as its data member,
to find the gross pay of an employee for the following allowances
and deduction.
Use meaningful variables. And input( ) calculate( ) and display( )
followed by main( ) function.
Dearness Allowance = 25% of the Basic Pay
House Rent Allowance = 15% of Basic Pay
Provident Fund = 8.33% of Basic Pay
Net Pay = Basic Pay + Dearness Allowance + House Rent
Allowance
Gross Pay = Net Pay − Provident Fund [15 marks]
Member methods:
Void input() - to input and store the detail of the customer
Void compute() -to compute the rental charge.
The rent for a mobike is charged on the following basis.
First five days Rs. 500 per day.
Next five days Rs. 400 per day.
Rest of the days Rs. 200 per day.
void display() to display the details in the following format:
Bike No. Phone No. No. of days Charge
--------- ------------ ------------- --------
(Board paper 2012)
Write a main method to create an object of the class and call the above
member methods. [15 marks]
4) void display() : To display the name and price of the book after discount.
Write a main method to create an object of the class and call the above member
methoids.