Develop a code for the multilevel inheritance diagram given below
· The person class consisting of data members such as name and age.
· The salary details class consisting of data members such as salary.
· The employee class consisting of data members such as degree and experience.
· The manager class consisting of member function pfund() to find the employee provident fund satisfying the condition total experience to be greater than 10 and salary to be greater than Rs. 20,000 and then calculate net salary = basic pay + pf. The provident fund amount sanctioned is Rs. 1800 for basic pay Rs 20,000 otherwise provident fund amount sanctioned is Rs. 750.
Create a class by name Area and initialize the data members. Then, find areas of square [Area(a)], area of rectangle [Area(l, b)], area of triangle [Area(a, b, c)] using constructor overloading. Also define a destructor to destroy the object.
Define a class Student with the following specification:
PRIVATE DATA MEMBERS:
regno integer sname 20 character s1, s2. s3 float total float
PUBLIC MEMBER FUNCTIONS:
Student() Default constructor to initialize data members, s1 = s2 = s3 = 0
Student(rn, sn, m, p, c) Parameterized constructor accept values for regno, sname, s1, s2 and s3
calculate() Function to calculate the student total marks
putdata() Function to display all the data members of student
~student() Destructor to destroy the data objects
create a class Customer with the following members:
Member variables: cid(integers) and cbalance (float).
Member functions:
Default(empty) constructor: It assigns cid and cbalance value as zero(0). Finally it print "Default Assignment".
Parameterized constructor: It receives two arguments and assign it to cid and cbalance.
void display(): This method display the values of cid and cbalance which are separated by a space.
Main method:
Implement the below code in main method and check your program output.
int main()
{
int cid;
float cbalance;
cin>>cid>>cbalance;
Customer obj1;
Customer obj2(cid,cbalance);
obj1.display();cout<<endl;
obj2.display();
return 0;
}
Create a class Customer with following details
Class
Method and Variables
Description
Customer
User defined class
int
cid
Private integer variable to denote customer id
float
balance
Private float variable to denote customer balance
int
bid
Private integer variable to denote branch id
static int
countbr
Public static integer variable and it should be initialized as zero
void get()
Public get method get the input from users such as cid, balance and bid
void find()
Public find method to find and update the number of customer having account at branch number 22 in countbr variable
static void dispalay()
This public static method display the value of the variable countbr
int main()
{
int n;
………..
………….
return 0
}
Define a class Flight with the following specifications: Private Members a data member are Flight number of type integer A data member Destination of type string A data member Distance of type float A data member Fuel of type float A member function CALFUEL() to calculate the value of Fuel as per the following criteria
Distance Fuel
<=1000 500
more than 1000 and <=2000 1100
more than 2000 2200
Public Members
Declare the class Employee, consisting of data members are emp_number, emp_name, department, salary and net_salary. The member functions are GetEmpDetails() to accept information for an employee, Calculate_DA() to calculate DA=20% of salary and display() to display the information of a employee.
input
1001
charlie
dubai
12000
output
1001
charlie
dubai
14400
Design a pay roll system to find the employee total salary using single inheritance. The base class employee consisting of data members such as emp_number and emp_name. The derived class salary consisting of data members such as Basic_pay, HRA, DA, PF, Net_pay.
Design a class Market to calculate the total expenses. Use appropriate member functions
i) The quantity and price per item are the data member of the class which is input by the user
2) discount of 10% is offered if the expense is more than 5000.
3) Calculate the total expenses
4) Display total amount, discount and Amount to pay
Write a C++ code to overload the function sqr() . In the first call of the function sqr(), an integer 15 is passed. The compiler executes the integer version of the function and returns result 225. In the second call a float value 2.5 is passed to function sqr(). The compiler executes the float value of the function and returns the result 6.25. The selection of which function to execute is decided at the run time by the compiler according to the datatype of variable passed.