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
svp [43]
3 years ago
7

Write a class named Employee that has private data members for an employee's name, ID_number, salary, and email_address. It shou

ld have an init method that takes four values and uses them to initialize the data members. It should have get methods named get_name, get_ID_number, get_salary, and get_email_address. Write a separate function (not part of the Employee class) named make_employee_dict that takes as parameters a list of names, a list of ID numbers, a list of salaries and a list of email addresses (which are all the same length). The function should take the first value of each list and use them to create an Employee object. It should do the same with the second value of each list, etc. to the end of the lists. As it creates these objects, it should add them to a dictionary, where the key is the ID number and the value for that key is the whole Employee object. The function should return the resulting dictionary. For example, it could be used l
Computers and Technology
1 answer:
mario62 [17]3 years ago
6 0

Solution :

class Employee:

   #Define the

   #constructor.

   def __$\text{init}$__($\text{self, nam}e$,  ID_number, $\text{salary}$, email):

       #Set the values of

       #the data members of the class.

       $\text{self.nam}e$ = name

       $\text{self.ID}$_number = ID_number

       $\text{self.salary}$ = salary

       self.email_address = email

#Define the function

#make_employee_dict().

def make_employee_dict(list_names, list_ID, list_salary, list_email):

   #Define the dictionary

   #to store the results.

   employee_dict = {}

   #Store the length

   #of the list.

   list_len = len(list_ID)

   #Run the loop to

   #traverse the list.

   for i in range(list_len):

       #Access the lists to

       #get the required details.

       name = list_names[i]

       id_num = list_ID[i]

       salary = list_salary[i]

       email = list_email[i]

       #Define the employee

       #object and store

       #it in the dictionary.

       employee_dict[id_num] = Employee(name, id_num, salary, email)

   #Return the

   #resultant dictionary.

   return employee_dict

You might be interested in
What is meant by hacking in internet ?ASAP PLEASEEEE​
yanalaym [24]
Im not sure if you mean in or by but heres my answer: Basically to attempt to exploit a private network, control over computers, viruses and such.
8 0
3 years ago
You can press and hold [Tab] and click the Normal button on the status bar to display the slide master.
tester [92]

Answer:

False.

Explanation:

No, By pressing and holding tab and clicking the normal button on the status bar will not help you in opening the slide master. By holding the shift key and pressing the first icon as shown in this figure will open the slide master for you.

5 0
3 years ago
Read 2 more answers
ASAP 20 Points please hurry
inna [77]

Answer:

All you got to do is type System.out printIn("Study English) etc...

Explanation:

Look at the answer to see if it is right.

7 0
4 years ago
Which code snippet calculates the sum of all the even elements in an array values? Group of answer choices int sum = 0; for (int
olganol [36]

Answer:

The second one:

int sum = 0; for (int i = 0; i < values.length; i++) { if ((values[i] % 2) == 0) { sum += values[i]; } }

5 0
3 years ago
A teacher has bookmarked a large number of webpages in Chrome while researching class topics. Unfortunately, he's bookmarked so
Oksi-84 [34.3K]
<span>Rename bookmarks so they are labeled clearly</span>
3 0
4 years ago
Other questions:
  • Which statement describes the word "iterative"?
    7·2 answers
  • If you save a Word file as a Web page, what type of file will it be?
    12·1 answer
  • Which answer best describes an unsubsidized federal loan
    9·1 answer
  • The rules that determine what is allowed in a program are known as the
    14·1 answer
  • How can an administrator force wireless clients to use a standard web browser to provide information, and require a user to agre
    10·1 answer
  • To use an imported image, simply drag it from the desktop onto the stage. true or false
    15·2 answers
  • Taking notes on a customer complaint is a form of a communication<br> TRUE OR FLASE
    10·1 answer
  • Not every design choice in your game interface requires having a thought process behind it.
    9·2 answers
  • What is pseudocode? O A way of describing a set of instructions in text form using plain english O A diagrammatic representation
    13·1 answer
  • Consider the practice of outsourcing programmers, a common practice in many U.S. businesses. Think about how this practice is us
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!