Programming Seta
Programming Seta
Number
SRMINSTITUTEOFSCIENCEANDTECHNOLOGY Set- A
SRM Nagar, Kattankulathur – 603203, Chengalpattu District, Tamil Nadu
College of Engineering and Technology
School of Computing
AcademicYear: 2023-24(Even)
1. Write a program in C++ to create a software that can assist the HR manager to account expenses
under salary head of employees. The company has 3 different types of employees. 1) Full Time
employees 2) Part time employees and 3) Consultants. The data requirements
• All employees have a name and employee ID
• Salary structure of full-time employee includes Basic Pay, DA and HRA
• Salary structure of part time employee includes No of days worked and Salary per day
• Salary structure of consultants includes hourly rate and no of hours worked
• All employees should be able to calculate their monthly earnings based on their specific attributes.
Create a C++ program using hierarchical inheritance to model this scenario. Implement classes
for each type of employee and demonstrate the ability to calculate monthly earnings for each type
of employee.
2. Implement a C++ program to calculate the area of different geometric shapes: circle, rectangle, and
triangle. Implement a base class Shape and derived classes Circle, Rectangle, and Triangle. Each
derived class should override the virtual function calculateArea() to compute the area of its
respective shape.
The program should allow the user to choose the shape type and input the necessary parameters
(e.g., length, width, radius, base, height) for calculating the area. Once the parameters are provided,
the program should calculate and display the area of the selected shape.
3. You are developing an application to calculate the tax amount on the selling price of the product.
Some products are measured in no of units (integers) and some other products are measured in
terms of fraction of kilograms (float). The tax is calculated as 18% of the total selling price of product.
Implement a function template named calculateTax() that takes two parameters: the unit price
and the number of units/fraction of kilograms. The function should work with input parameters
provided as integer and float. Use C++ programming for implementation.