Write a program that would print the information (name, year of joining, salary, address) of threeemployees by creating a class named 'Employee
Question
Write a program that would print the information (name, year of joining, salary, address) of threeemployees by creating a class named 'Employee
Solution
Sure, here is a simple Python program that creates a class named 'Employee' and prints the information of three employees:
class Employee:
def __init__(self, name, year_of_joining, salary, address):
self.name = name
self.year_of_joining = year_of_joining
self.salary = salary
self.address = address
def print_info(self):
print("Name: ", self.name)
print("Year of Joining: ", self.year_of_joining)
print("Salary:
Similar Questions
Write a programme in C++ which read and print employee information with department and pf information using hierarchical inheritance
Design a structure in C to represent an employee's information, including their name, employee ID, department, and salary. Additionally, write a program that allows users to input employee data, display employee information, and update an employee's salary. write a code for demonstrating the implementation of the structure and program functionalities.input and output Enter employee details:Enter employee name: John DoeEnter employee ID: 101Enter department: SalesEnter salary: 50000Employee Information:Name: John Employee ID: 101 Department:Sales Salary: 50000.00Enter new salary: 55000Salary updated successfully.Updated Employee Information:Name: JohnEmployee ID: 101Department: SalesSalary: 55000.00
Define a class Employee. Display the personal salary details of three employeesusing single inheritance
Create the class Employee with name, Empid, address, mailid, mobileno as data members.Inherit the classes programmer,Asstprofessor, Associateprofessor and Professor from employee class.Add Basic Pay (BP) as the member of all the inherited classes..Calculate DA as 97% of BP, HRA as 8% of BP, PF as 10% of BP, Staff club fund as 0.1% of BP.Calculate gross salary and net salary.Generate payslip for programmer categories of employees.Calculate DA as 97% of BP, HRA as 10% of BP, PF as 12% of BP, Staff club fund as 0.1% of BP.Calculate gross salary and net salary.Generate payslip for Asstprofessor categories of employees.Calculate DA as 97% of BP, HRA as 7% of BP, PF as 13% of BP, Staff club fund as 0.1% of BP.Calculate gross salary and net salary.Generate payslip for Associateprofessor categories of employees, Create the objects for the inherited classes and invoke the necessary methods to display the Payslip.Calculate DA as 97% of BP, HRA as 4% of BP, PF as 13% of BP, Staff club fund as 0.2% of BP.Calculate gross salary and net salary.Generate payslip for Professor categories of employees,Choose the options 1.PROGRAMMER 2.ASSISTANT PROFESSOR 3.ASSOCIATE PROFESSOR 4.PROFESSORinput2Arun [email protected], Anna Nagar, Chennai-6550029876543210 20000outputArun [email protected] 12, Anna Nagar, Chennai65987654321020000.019400.02000.02400.02000.041400.037000.0
Define a class “employee” having employee id, name and salary use accept and to-string method to display and create n employee’s data and find the total salary of all employees and find the name of the employee who is having maximum salary.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.