Question

Write a class named Employee that holds the following data about an employee in attributes: name,...

Write a class named Employee that holds the following data about an employee in
attributes: name, ID number, department, and job title. Don't include a constructor
or any other methods. Written in Python and formatted like it says below!!!!!

Once you have written the class, write a program that creates three Employee objects
to hold the following data:

Name ID Number Department Job Title
Susan Meyers 47899 Accounting Vice President
Mark Jones 39119 IT Programmer
Joy Rogers 81774 Manufacturing Engineering

The program should store this data in three Employee objects and then print the
data for each employee.

Name:·Susan·Meyers↵

ID·Number:·47899↵

Department:·Accounting↵

Job·Title:·Vice·President↵ ↵

Name:·Mark·Jones↵

ID·Number:·39119↵

Department:·IT↵

Job·Title:·Programmer↵

↵ Name:·Joy·Rogers↵

ID·Number:·81774↵

Department:·Manufacturing↵ Job·Title:·Engineer↵

0 0
Add a comment Improve this question Transcribed image text
Answer #1

class Employee:

    name = ''

    ID_number = ''

    department = ''

    job_title = ''

ob1 = Employee()

ob1.name = 'Susan Meyers'

ob1.ID_number = '47899'

ob1.department = 'Accounting'

ob1.job_title = 'Vice President'

ob2 = Employee()

ob2.name = 'Mark Jone'

ob2.ID_number = '39119'

ob2.department = 'IT'

ob2.job_title = 'Programmer'

ob3 = Employee()

ob3.name = 'Joy Rogers'

ob3.ID_number = '81774'

ob3.department = 'Manufacturing'

ob3.job_title = 'Engineer'

print('Name :', ob1.name)

print('ID Number :', ob1.name)

print('Department :', ob1.name)

print('Job Title :', ob1.name)

print('\nName :', ob2.name)

print('ID Number :', ob2.name)

print('Department :', ob2.name)

print('Job Title :', ob2.name)

print('\nName :', ob3.name)

print('ID Number :', ob3.name)

print('Department :', ob3.name)

print('Job Title :', ob3.name)


Sample Output

C:\Users\Rishab\Desktop>python Employee.py Name Susan Meyers ID Number: 47899 Department Accounting Job TitleVice President Name Mark Jone ID Number 39119 Department IT Dob Title Programmer NameJoy Rogers ID Number 81774 epartment Manufacturing Job TitleEngineer

Add a comment
Know the answer?
Add Answer to:
Write a class named Employee that holds the following data about an employee in attributes: name,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a C++ program Write a class named Employee that has the following member variables: name...

    Write a C++ program Write a class named Employee that has the following member variables: name A string that holds the employee name idNumber An int to hold employee id number department A string to hold the name of the department position A string to hold the job position The class will have three constructors: 1. A constructor that accepts all the internal data such as: Employee susan("Susan Meyers", 47899, "Accounting", "Vice President"); 2. A constructor that accepts some of...

  • Design and write a class named Employee that inherits the Person class from the previous exercise...

    Design and write a class named Employee that inherits the Person class from the previous exercise and holds the following additional data: ID number, department and job title. Once you have completed the Employee class, write a Python program that creates three Employee objects to hold the following data: Name ID Number Department Job Title Phone Susan Meyers 47899 Accounting Vice President 212-555-1212 Mark Jones 39119 IT Programmer 212-555-2468 Joy Rogers 81774 Operations Engineer 212-555-9753 The Python program should store...

  • Create a C# Console program. Add a class named Employee that has the following public fields:...

    Create a C# Console program. Add a class named Employee that has the following public fields: • Name. The name field references a String object that holds the employee’s name. • IDNumber. The IDNumber is an int that holds the employee’s ID number. • Department. The department field is a String that holds the name of the department where the employee works. • Position. The position field is a String that holds the employee’s job title. Once you have written...

  • Part 1 (employee.py): Write a class name Employee that holds the following data about an employee...

    Part 1 (employee.py): Write a class name Employee that holds the following data about an employee in attributes:name, ID number, department and job title. Once you have written the class, write a program that creates three Employee objects to hold the following data: The program should store this data in the three objects, then display the data for each employee on the screen as a table like this (Use fstring or "format" function to format the output as a table,...

  • Using C++, Write a class named Employee that has the following member variables: name. A string...

    Using C++, Write a class named Employee that has the following member variables: name. A string that holds the employee's name. idNumber. An int variable that holds the employee's ID number. department. A string that holds the name of the department where the employee works. position. A string that holds the employee's job title. The class should have the following constructors: A constructor that accepts the following values as arguments and assigns them to the appropriate member variables: employee's name,...

  • Create a c++ code and answer number 1 Homework Ch. 13 - Employee Class 30 points...

    Create a c++ code and answer number 1 Homework Ch. 13 - Employee Class 30 points Design a class named Employee that has the following attributes: * Name ID Number- (Employee's] Identification Number " Department-the name of the department where the employee works " Position-the employee's job title The class should have the following constructors: A constructor that accepts values for all the member data as arguments A constructor that accepts the following values as arguments and assigns them to...

  • 1. Write a class named Employee that holds the following data about an employee in attributes:...

    1. Write a class named Employee that holds the following data about an employee in attributes: name, ID number, department, and job title. (employee.py) 2. Create a UML diagram for Employee class. (word file) 3. Create a program that stores Employee objects in a dictionary. Use the employee ID number as the key. (employee_App.py) The program should present a menu that lets the user perform the following actions: ✓ Look up an employee in the dictionary ✔ Add a new...

  • It must be C++ Chapter 13 Programming Challenge 2: Employee Class. See instruction: Chapter 13 Programming...

    It must be C++ Chapter 13 Programming Challenge 2: Employee Class. See instruction: Chapter 13 Programming Challenge 2 Employee Class.pdf Program Template: // Chapter 13, Programming Challenge 2: Employee Class #include <iostream> #include <string> using namespace std; // Employee Class Declaration class Employee { private: string name; // Employee's name int idNumber; // ID number string department; // Department name string position; // Employee's position public: // TODO: Constructors // TODO: Accessors // TODO: Mutators }; // Constructor #1 Employee::Employee(string...

  • Create a date class with attributes of month, day, and year. Create an employee class for...

    Create a date class with attributes of month, day, and year. Create an employee class for storing information related to employee information for the CS1C Corporation. This class should contain the employee’s name, employee’s Id, phone number, age, gender, job title, salary, and hire date. You should write a series of member functions that change the employee’s name, employee’s Id, phone number, age, job title, salary, and hire date. You should use your date class (composition) when accessing hire date....

  • Create a date class with attributes of month, day, and year. Create an employee class for...

    Create a date class with attributes of month, day, and year. Create an employee class for storing information related to employee information for the CS1C Corporation. This class should contain the employee’s name, employee’s Id, phone number, age, gender, job title, salary, and hire date. You should write a series of member functions that change the employee’s name, employee’s Id, phone number, age, job title, salary, and hire date. You should use your date class (composition) when accessing hire date....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT