We want to calculate the total marks of each student of a class in Physics, Chemistry, and Mathematics and the average marks of the class. The number of students in the class is entered by the user. Create a class named Marks with data members for roll number, name, and marks. Create three other classes inheriting the Marks class, namely Physics, Chemistry, and Mathematics, which are used to define marks in the individual subjects of each student. The roll number of each student will be generated automatically.
Write a C++ program to find the max of an integral data set. The program will ask the user to input the number of data values in the set and each value. The program prints on the screen a pointer that points to the max value.
Create a 'Rectangle' class with two data members, length and breadth, and a function to calculate the area that is 'length*breadth'. The class has three constructors, which are as follows:
a - no parameter - length and breadth values are both set to zero.
b - using two numbers as parameters, one for length and one for breadth.
c - Using a single number as a parameter - that number is assigned to both length and breadth.
Now, create objects of the 'Rectangle' class having none, one, and two parameters and print their areas.
Write a program to calculate the salary of Indian Railway employees. Three
are three types of employees in Indian railways. They are regular, daily wages
and consolidated employees. Gross Pay for the employees is calculated as
follows:
a - regular employees = basic + HRA + (10%of DA * basic)
b - Daily wages = wages per hour * number of hours
Write a program that takes as input your gross salary and your total saving and uses another function named taxCalculator() to calculate your tax. The taxCalculator() function takes as parameters the gross salary as well as the total savings amount. The tax is calculated as follows:
(a) The savings is deducted from the gross income to calculate the taxable income. The maximum deduction of savings can be Rs. 100,000, even though the amount can be more than this.
(b) For up to 100,000 as taxable income the tax is 0 (Slab 0); beyond 100,000 to 200,000 tax is 10% of the difference above 100,000 (Slab 1); beyond 200,000 up to 500,000 the net tax is the tax calculated from Slab 0 and Slab 1 and then 20% of the taxable income exceeding 200,000 (Slab 2); if its more than 500,000, then the tax is tax from Slab 0, Slab 1, Slab 2 and 30% of the amount exceeding 500,000.