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.
Design the class Vowel to find the number of vowels present in the given string. Define the constructor member function to assign the values and destructor member function to destroy the data objects.
Create a class called employee with the following details as variables within it.
1. Name of the employee
2. Age
3. Designation
4. Salary
Get the details of 5 employees and initialize it using Constructor. Release resources using destructor. print the name, designation and salary of employees, Find the highest salaried employee in professor grade and display their details.
Create the class Student consisting of data members register_no and name. Define array of objects by using constructor Student() to assign the values for the class Student data members, display() member function is used to display the information of student. Finally free the resources of data objects using destructor member function. (Note: Define object size of two)
Design a class TBills to include customer_id, customer_name, phone number, calls and usagecost and also include the following member functions
-getCustomerData()- To input customer data(customer_id, customer_name, phone number,calls)
-usage_cost() - to calculate the monthly telephone bills and calculate the usage cost of telephone bill 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.
-monthlyTelephoneBills() - to display monthly telephone bills of customer
Design a class Calendar to calculate number of years, months and days. The member variables are nds, years, months and days. The member functions are d() which accepts number of days and display() to display total number of years, months and days.
In a company an employee is paid as under: If his basic salary is less than Rs. 1500, then HRA = 10% of basic salary and DA = 90% of basic salary. If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA = 98% of basic salary. If the employee's salary is input by the user write a program to find his gross salary.
Numbers in String - 1
Given a string, write a program to return the sum and average of the digits of all numbers that appear in the string, ignoring all other characters.Input
The input will be a single line containing a string.Output
The output should contain the sum and average of the digits of all numbers that appear in the string.
Note: Round the average value to two decimal places.Explanation
For example, if the given string is "I am 25 years and 10 months old", the digits of all numbers that appear in the string are 2, 5, 1, 0. Your code should print the sum of all digits(8) and the average of all digits(2.0) in the new line.
Sample Input 1
I am 25 years and 10 months old
Sample Output 1
8
2.0
Sample Input 2
Tech Foundation 35567
Sample Output 2
26
5.2
First Perfect Square
Given two integers (M and N), write a program to print the first perfect square in a given range.Input
The first line of input will contain a positive integer (M).
The second line of input will contain a positive integer (N).Output
The output should be a single line containing the first perfect square in a given range.Explanation
For example, if the given numbers are M is 4 and N is 16, the perfect squares from 4 to 16 are 4(2 * 2), 9(3 * 3), and 16(4 * 4), as the first perfect square is 4. So the output should be 4.
Sample Input 1
4
16
Sample Output 1
4
Sample Input 2
5
8
Sample Output 2
No Perfect Square