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
What are some example of popular music for teenagers
Stells [14]

Answer: Hip Hop, Rap, Alternative, Pop Rock

Explanation:

8 0
3 years ago
Read 2 more answers
A form that dedicates a page for each item retrieved for a case; it allows investigators to add more detail about exactly what w
gregori [183]

Answer:

Single-evidence form​

Explanation:

Single-evidence form​  dedicates a page for each item retrieved for a case; it allows investigators to add more detail about exactly what was done to the evidence each time it was taken from the storage locker.

4 0
4 years ago
How to make a negative number positive in excel
Viefleur [7K]

Answer:

DB * -1

Explanation:

Use this formula: DB * -1

DB = Desired Box

DB * -1

4 0
3 years ago
Pls help me pass my finals!!​
ale4655 [162]

Answer:

(a): power(2&-2)

The code is as follows:

<em>power = 2**-2</em>

<em>print(power)</em>

<em />

(b): Largest and smallest in a list

The code is as follows:

<em>num = [33,6,11,100,456,109,-4,366]</em>

<em>smallest= min(num)</em>

<em>largest= max(num)</em>

<em>print(smallest)</em>

<em>print(largest)</em>

<em />

(c): Loop in Python

(i) Loop are instructions that are repeated until a certain condition is met;

(ii) For loop, in python are used to iterate over a sequence or through a certain range;

The syntax is:

<em>for loop_element in range(iterating_range):</em>

The following is an illustration of for loop that iterates 5 times

<em>for i in range(5):</em>

Explanation:

(a): power(2&-2)

The ** is used to calculate power.

So, 2**-2 represents 2 raise to power -2

<em>power = 2**-2</em>

This prints the calculated power

<em>print(power)</em>

<em />

(b): Largest and smallest in a list

This initializes the list

<em>num = [33,6,11,100,456,109,-4,366]</em>

This calculates the smallest using min() function

<em>smallest= min(num)</em>

This calculates the largest using max() function

<em>largest= max(num)</em>

This prints the smallest and the largest

<em>print(smallest)</em>

<em>print(largest)</em>

<em />

(c): See answer section

3 0
3 years ago
MD5 uses a hash value to create a hash which is typically a 32 character hex number and how many bits?
ryzh [129]

Answer:

128 bits

Explanation:

The MD5, which is the acronym for Message-Digest algorithm 5, invented by a professor of MIT, Ronald Rivest, is a cryptographic hash algorithm that creates a 128 bit hash value and is typically represented as a 32 character hex number. MD5 is the improved version of MD4 which was also created by the same professor.

Following is an example format of an MD5 hash;

<em>ef55d3a698d289f2afd663725127bccc</em>

MD5 has been proven to have security issues. One of these issues is called collision attack - a situation where the same hash is produced for different input data.

8 0
4 years ago
Other questions:
  • Chris has received an email that was entirely written using capitalization. He needs to paste this text into another document bu
    13·2 answers
  • High quality pages in a task should all get the same Needs Met rating. For example, a high quality page for a common interpretat
    9·1 answer
  • QUESTION 8 Software applications that generate information are located in the first tier of n-tier architectures. True False
    7·1 answer
  • What two optical disc drive standards support writing discs with a total capacity of 8.5gb?
    12·1 answer
  • A Chief Information Security Officer (CISO) needs to establish a KRI for a particular system. The system holds archives of contr
    13·1 answer
  • What is a google search query that will search for xml files on the domain example.Com
    8·1 answer
  • Teachers can organize the classroom environment to facilitate activities and to prevent problems. True Or False
    15·1 answer
  • PLZ HELP!! How does HTML help solve the problem of telling a computer what a web page looks like, not just the content that is o
    15·1 answer
  • Which of the following is NOT an example of one of the six primary ways businesses use the Internet?
    10·2 answers
  • You have two identical print devices that are set up in a work room. Currently, the Windows print server has two printers config
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!