1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alexxx [7]
3 years ago
14

Write a class named 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 python program that creates 3 Employee objects to hold the following data:
Name: Susan Meyers, ID number: 47899, Department: Accounting, Job Title: Vice President
Name: Mark Jones, ID Number: 39119, Department: IT, Job Title: Programmer
Name: Jon Rogers, ID Number: 81774, Department: Manufacturing, Job Title: Engineer
The prgram should store this data in the 3 objects and then display the data for each employee on the screen.
Computers and Technology
1 answer:
viktelen [127]3 years ago
4 0

firstly we have to create class and then constructors and method

let start with class

class Employee:

   def __init__(self, name, id, department, title):

       self.__name = name

       self.__id = id

       self.__department = department

       self.__title = title

   def set_name(self, name):

       self.__name = name

   def set_id(self, id):

       self.__id = id

   def set_department(self, department):

       self.__department = department

   def set_title(self, title):

       self.__title = title

   def get_name(self):

       return self.__name

   def get_id(self):

return self.__id

   def get_department(self):

       return self.__department

   def get_title(self):

       return self.__title

def __str__(self):

       return 'Name: ' + self.__name + \

              '\nID number: ' + self.__id + \

              '\nDepartment: ' + self.__department + \

              '\nTitle: ' + self.__title

Now to test the program

import emp

def main():

   emp1 = emp.Employee('name', 'id', 'department', 'title')

   emp2 = emp.Employee('name', 'id', 'department', 'title')

   emp3 = emp.Employee('name', 'id', 'department', 'title')

 

   emp1.set_name('Susan Meyers')

   emp1.set_id('47899')

   emp1.set_department('Accounting')

   emp1.set_title('Vice President')

   emp2.set_name('Mark Jones')

   emp2.set_id('39119')

   emp2.set_department('IT')

   emp2.set_title('Programmer')

   emp3.set_name('Joy Rogersr')

   emp3.set_id('81774')

   emp3.set_department('Manufacturing')

   emp3.set_title('Engineer')

   print()

   print(emp1)

   print()

 print(emp2)

   print()

   print(emp3)

main()

You might be interested in
The computers in the administrative offices of the four schools throughout the district are networked to enable employees to acc
muminat
These computers in administrative offices or schools throughout the district that are networked to each other has the type of network most likely used by the workers is LAN network. Usually LAN networks are used in small offices or rooms.
3 0
4 years ago
You listened to a song on your computer. Did you use hardware, software, or both?
Bogdan [553]
The answer to your question is: <span>Explain- </span>
<span>The CPU, monitor, speaker or earphone, keyboard, mouse etc. that you can touch are hardware. </span>
<span>The software or program such as the operating system, windows media player, ms office, paint etc that you cannot touch actually but they are shown on the monitor are called software. </span>

<span># You play the music with Windows media player or any music player that means you are using software. And the software itself is showing on the monitor(hardware) that is run by CPU, another hardware. </span>

<span>Hope you got it.. Please give me brnliest.



</span>
7 0
3 years ago
Read 2 more answers
A specific, individual computer or other network device in a domain is known as what?
KIM [24]
Hi I hope this helps. The answer is host.
5 0
3 years ago
You are asked to write the Point class in order to use point-type objects as follows:
Ymorist [56]

Answer:

what is this i don't understand

4 0
3 years ago
should gaming be considered as a sport? Why or why not? (Your opinion) and please have a good aurgumant.
Sidana [21]
It's part not and part it's okay becuase sometimes gaming can help you in sports thats what happen to me it made me a beder player on the soccer team.

But your not really geting you bones exsesize then you get a brain cramp.
8 0
3 years ago
Read 2 more answers
Other questions:
  • Write an expression that whose value is the fifth character of the string name.
    10·1 answer
  • Write a python program that asks the user to enter a student's name and 8 numeric tests scores (out of 100 for each test). The n
    5·1 answer
  • How to find the largest number in an array java?
    13·1 answer
  • As discussed in the video, parallax measurements allow us to calculate distances to stars for which parallax is detectable. Supp
    14·1 answer
  • The Mark Table of Contents Entry option is used for marking nonheading text for the table of contents. the options are manually
    5·2 answers
  • A college has 2.3 ratio of men to women in its student body you what is the ratio of women to men
    15·1 answer
  • Which of these is an example of collective voice?
    8·2 answers
  • George is working with an image in Photoshop. He added a lot of effects to the image. He saved the first draft of the file. The
    6·2 answers
  • Brenda also orders movies and television through the Internet via a(n) ____ provider, which allows users to download video for a
    8·1 answer
  • Which statements are TRUE about web services protocols? (Select TWO responses) SOAP and REST are both web service communication
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!